Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
6 lines (4 sloc) 119 Bytes
def factorial(top)
top.downto(1).inject(:*)
end
puts factorial(100).to_s.split('').inject(0){|sum,n| sum += n.to_i}