From Australian voting problem:
A bot will keep putting information and it can reach 1000 lines.
Example of what he’ll enter:
"1 2 3
2 1 3
2 3 1
1 2 3
3 1 2
"
How do I know when he has finished entering information? There is an extra \n at the end and that’s my only guess on where to go.
cin doesn’t seem to detect \n, but getchar() apparently does. It will however get the \n even after the first line of course, and getting it to work has become rather difficult. How do I accomplish this?
1 Answer