On Nov 28, 2011, at 06:33 , Gaurav C. wrote:

> $stdin.gets
> puts $stdin.readlines.map(&:to_i).sort
> 
> It's interesting to take all the input at once but I run the code above 
> and it seems like it never stops taking input?

It depends on how you're running the code. I was doing it like:

blah.rb < inputfile

$stdin.readlines reads until input EOFs.