Page 1 of 1

Problem about 11122

Posted: Wed Sep 12, 2007 5:51 pm
by Mr.south
I don't know what happen to the new judge

I have submitted about 20 times of the problem

every time, I got a runtime error

even i use the following code, i still get runtime error:

i think the following code will not get runtime error, but it still occurs.


#include <stdio.h>

int main()
{
int pair;
int i, j, k;
int a, b;

scanf("%d", &pair);

for(i=1;i<=pair;i++)
{
for(j=0;j<2;j++)
{
for(k=0;k<3;k++)
{
scanf("%d%d", &a, &b);
}
}

printf("pair %d: ", i);
printf("yes");
printf("\n");
}
}

Posted: Wed Sep 12, 2007 6:51 pm
by mf
When your program terminates with a non-zero exit code, it is treated as a runtime error. So, if you use C, you should always put 'return 0;' at the end of main(). Or you can resubmit your code as C++, and the compiler would insert that statement automatically for you.

Posted: Wed Sep 12, 2007 7:45 pm
by Mr.south
thanks for your reply

but i didn't met the problem when i use the old judge system

thank you anyway

Posted: Wed Sep 12, 2007 7:49 pm
by mf
Old system didn't check program's exit code, but the new one does.