6 lines
87 B
Ruby
Raw Normal View History

2012-03-09 10:43:52 +01:00
num = 2 ** 1000
sum = 0
num.to_s.chars do |digit|
sum += digit.to_i
end
puts sum