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 1007. Code Words

How to define when the program should stop working?
Posted by xakac [BMSTU] 11 Feb 2006 21:25
I tried to leave main cycle when the input is null-string, but I got "Output Limit Exceeded". More over, the problem says that there may be some line breaks.
So what the point?
Re: How to define when the program should stop working?
Posted by void off() 11 Feb 2006 23:12
Use feof(stdin) or cin.eof()
I use either of 2 ways (+)
Posted by Michael Rybak (accepted@ukr.net) 12 Feb 2006 06:21
1. while (scanf(..) != EOF)

2. while (cin.peek() != EOF)