=begin n! means n × (n − 1) × ... × 3 × 2 × 1 Find the sum of the digits in the number 100! =end num = 100 tot = 1 num.downto 2 do |n| tot *= n end sum = 0 (tot.to_s.length-1).downto 0 do |digitnum| sum += tot.to_s[digitnum,1].to_i end print(sum)