blob: d538cfecf27f87f0789becdda5ee42ea3d27ec60 (
plain) (
tree)
|
|
#!/usr/bin/bc
scale = 0
# from the bc man page
define fact (x) {
if (x <= 1) return (1);
return (fact(x-1) * x);
}
total = 0
num = fact(100)
while (num > 0) {
total += num % 10
num = num / 10
}
total
|