Problem about 11122

The forum to report every bug you find or tell us what you'd like to find in UVa OJ

Moderator: Board moderators

Locked
Mr.south
New poster
Posts: 11
Joined: Thu Jan 25, 2007 1:45 pm

Problem about 11122

Post 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");
}
}
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Post 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.
Mr.south
New poster
Posts: 11
Joined: Thu Jan 25, 2007 1:45 pm

Post by Mr.south »

thanks for your reply

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

thank you anyway
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Post by mf »

Old system didn't check program's exit code, but the new one does.
Locked

Return to “Bugs and suggestions”