summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-14 20:16:37 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-14 20:16:37 -0500
commit2fc6f19889b3a2d0a1d2c28706a488e6206983ae (patch)
treedc39368fb567843b2ee2fc88bb3ad46cba2770b5
parent97f18c609654664782441bca016a400b7592e4c9 (diff)
downloadprojecteuler-2fc6f19889b3a2d0a1d2c28706a488e6206983ae.tar.gz
projecteuler-2fc6f19889b3a2d0a1d2c28706a488e6206983ae.zip
problem 16 solution
-rw-r--r--016.bc10
1 files changed, 10 insertions, 0 deletions
diff --git a/016.bc b/016.bc
new file mode 100644
index 0000000..1d30fd9
--- /dev/null
+++ b/016.bc
@@ -0,0 +1,10 @@
+#!/usr/bin/bc
+
+scale = 0
+total = 0
+num = 2^1000
+while (num > 0) {
+ total += num % 10
+ num = num / 10
+}
+total