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