ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

So, where the input stream ends ?
Posted by Black^n^White 6 Jan 2007 20:04
As I understand the user can use new line to seperate the numbers, but how can we know which "Enter" is the last one (or the input stream ends) ?
Re: So, where the input stream ends ?
Posted by Roma Labish[Lviv NU] 6 Jan 2007 20:23
See FAQ.
Re: So, where the input stream ends ?
Posted by Black^n^White 6 Jan 2007 21:19
Thanks.
Any examples for C# ?
Re: So, where the input stream ends ?
Posted by Roma Labish[Lviv NU] 6 Jan 2007 22:21
Ask Vladimir Yakovlev...
Re: So, where the input stream ends ?
Posted by Squid 7 Jan 2007 03:13
And example for Java, plz
Re: So, where the input stream ends ?
Posted by Vladimir Yakovlev (USU) 7 Jan 2007 07:43
Read with Console.Read() char by char. When the end of input stream was reached method returns -1.
Re: So, where the input stream ends ?
Posted by C# LvivNU 7 Jan 2007 16:16
Also, you can use
Console.In.ReadToEnd();
Re: So, where the input stream ends ?
Posted by Squid 9 Jan 2007 01:57
Vladimir Yakovlev (USU) wrote 7 January 2007 07:43
Read with Console.Read() char by char. When the end of input stream was reached method returns -1.
Will Reader.read() in Java have the same effect?
Re: So, where the input stream ends ?
Posted by Slam [Tartu U] 9 Jan 2007 02:33
Java :

while((line = f.readLine()) != null)
{
...
}
Re: So, where the input stream ends ?
Posted by Frank Rodriguez 2 Jan 2008 01:11
?? I tried that and it didnt work... the program never stops... Does anybody know how to stop the infinite loop?