16 lines
223 B
Ruby
Raw Normal View History

2012-03-09 13:56:02 +01:00
FACTORIAL = 100
def factorial(num)
if(num == 0)
return 1
else
return num * factorial(num - 1)
end
end
number = factorial(FACTORIAL)
sum = 0
number.to_s.each_char do |c|
sum += c.to_i
end
puts sum