More than 5 years have passed since last update.
puts gets.chomp.chars.map(&:to_i).inject(:+)
Register as a new user and use Qiita more conveniently