C question

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
tgoulart
New poster
Posts: 42
Joined: Sat Oct 21, 2006 8:37 am
Location: Alegrete, Brazil

C question

Post by tgoulart »

At Waterloo's contest, I submitted 3 problems and all of them got RE. I had no idea why that was happening, so I just waited the problems to be available on the OJ and submitted again, and 2 got AC and the other WA, so here is my question...

Did this happen because I didn't put a *return 0;* on the last line or should be something else?

I can send one of the codes if needed.
Thiago Sonego Goulart - UFMG/Brazil
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

If you submitted your solutions as plain C, then the missing "return 0" could indeed be the problem -- in that case your main function just returns whatever it finds on the top of the stack (which is most likely not zero). From the judge's point of view, your program's exit code was not zero, thus your program did not terminate correctly.
tgoulart
New poster
Posts: 42
Joined: Sat Oct 21, 2006 8:37 am
Location: Alegrete, Brazil

Post by tgoulart »

I know how it works. My question is if the new system requires the "return 0", since the current one doesn't.

But thank you anyway.
Thiago Sonego Goulart - UFMG/Brazil
Post Reply

Return to “C”