The professor is not actually compiling your code, the idea is to know whether you can pseudo code a solution, of course.
> if it had one single error (missed semicolon) or didn't compile for some reason, the whole thing was considered wrong
From GP
That's exceedingly rare I imagine, and stupid.
I had to hand-write 90% of my programming exams. Nobody cared about semicolons, they cared if your algorithm worked. You didn't even really need to program in C, just something that looked close enough.