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

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
oldbam
New poster
Posts: 17
Joined: Tue Sep 14, 2004 9:30 am

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

Post 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:
Life is beautifull !!!
anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post 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.
"Everything should be made simple, but not always simpler"
Post Reply

Return to “C++”