Page 1 of 1

Have you ever been to USACO? Problem with submitting in C++

Posted: Fri Sep 17, 2004 6:55 pm
by oldbam
Hi! I can't submit my programme on USACO - the grade shows
Your program ('prg') exited with signal #139 () when presented with test case 2, shown below...
I consider the problem is with my I/O, as the first test my programme passes. Here is my code:
[cpp]
#include <stdio.h>
#include <stdlib.h>

[global variables declaration]

int main(void)
{
FILE *fin, *fout;
fin = fopen("prg.in", "r");
fout = fopen("prg.out", "w");
fscanf(fin, "%d %d %d\n", &a, &b, &n);

[ ...C O D E ...]

fprintf(fout, "%d %d\n", q+1, color[q]);
exit(0);
}
[/cpp]
Can anyone help me? :cry:

Posted: Sat Sep 18, 2004 9:23 pm
by anupam
I am not sure, but
1) don't use exit(0), no need
2) The problem is not in your submission, it is a runtime error generated by your program. If this happens, your submission and reading data are right.

You can search usaco instruction set for the compiler they use to find error#139(?).
It may help you.