This loop goes through all the lines in the file but there are only six lines and it has seven outputs
How to stop a loop before it gets to the last one
Collapse
X
-
You're using C#, aren't you?
Ok, so you need to build a guard around the while loop at line 26. You can do it the easy way and write:
Code:while ( (!cin.eof()) && (count <= scores_in_section) )
Code:if (!cin.eof()) { while ( count <= scores_in_section ) { . . . } }
Comment
Comment