Heh, hi again
1. Again - some people solved that problem, but this time it is an old problem with some old formatting requirements and, yes, you have to print those "... 6 by team X" lines.
2. yes - the last line might end with EOF (not sure about this particular one, but, in general, it is a good idea to check)
3. EOL is 0x0a, EOF is not 0x0d - it is -1 (but I wouldn't rely on that)
Here, if you are not sure about something, check my list of solved problems, if I solved it, it is definitely working (my solutions are mostly in Java)
http://acmicpc-live-archive.uva.es/nuev ... ?user=4733
My code for this one is ugly, a lot of formatting stuff.
Anyway, if you have doubts, maybe it is better to post in appropriate forum. Not many people come here, though, I'll help if I can.