S = gets.split.map(&:to_i) p S # S = [123,456,789] # sum = 0 # p S.inject{|sum,x| sum + x } # list = "S".chars.map(&:to_i) # p list # p list.inject(:+)