diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-05-14 20:16:37 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-05-14 20:16:37 -0500 |
commit | 2fc6f19889b3a2d0a1d2c28706a488e6206983ae (patch) | |
tree | dc39368fb567843b2ee2fc88bb3ad46cba2770b5 | |
parent | 97f18c609654664782441bca016a400b7592e4c9 (diff) | |
download | projecteuler-2fc6f19889b3a2d0a1d2c28706a488e6206983ae.tar.gz projecteuler-2fc6f19889b3a2d0a1d2c28706a488e6206983ae.zip |
problem 16 solution
-rw-r--r-- | 016.bc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -0,0 +1,10 @@ +#!/usr/bin/bc + +scale = 0 +total = 0 +num = 2^1000 +while (num > 0) { + total += num % 10 + num = num / 10 +} +total |