scores = [] inputs = gets.chomp inputs.chars{ |score| (score === '0') ? scores.push(10) : scores.push(score.to_i) } puts scores.sum