require 'bigdecimal' require 'bigdecimal/util' sum=(0.0).to_d gets.to_i.times{ sum+=gets.to_d } puts sum.floor(10).to_s("f")