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

help to how to end reading input in java
Posted by karthik reddy 3 Oct 2019 10:19
I tried to solve this problem in java since we have to accept as many number of lines given in input I wrote a while loop as follows

while (in.hasNextLine()) // in is scanner object
{
     // read input and do stuff
}

but this loop seems to run forever how do I stop the loop from running.