s = "11 22 44 -42 33 "p items = s.split.map(&:to_i)
Standard input is empty
[11, 22, 44, -42, 33]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!