n = gets.chomp.to_i
puts (1..n).to_a.to_s.each_char.inject(0){|sum, d| sum += d.to_i}
I'm particularly interested in the second string of the code.




Posted 28 March 2012 - 01:54 AM
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
