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....
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....