I just started learning some ruby, and I want to do something like this:
print "Insert two numbers: "
a, b = gets.split(" ")
but I want to make a and b to be integers at the same time (in the same line).. If I add
to the second line (before or after
), it doesn't work... so, how should I approach this? mapping, splitting, slicing? ok, I know I could use scanf, but other than scanf, how would I do this?
sorry for such a noobish question, but I just couldn't find a good enough answer only googling...