Entering data...

Add a reply

Posted by newarade47 210 days ago:
Please help me in clearing my doubt as i m new to ruby...
suppose i want to enter two numbers
then i will get them as
puts "Enter two numbers"
STDOUT.flush
x = gets.chomp
y = gets.chomp
and then convert these to integer using (.to_i)

how can i get these numbers using "stdin"
as here in codegolf we need to input numbers by stdin only....
Posted by flagitious 186 days ago:
gets uses stdin

Add a reply