|
|
back to boardShow all messages Hide all messagesassert function doesn't work here. for the program i used assert.it failed there was no response #include<iostream> #include<cassert> using namespace std; int main(){ assert(0==1); return 0; } the above program must result in a statement program aborted.But instead the program gives WA assert() function outputs a message and ends the program with nonzero return code. Of course, the Judge interprets such behaviour as wrong answer. It is not "of course" becase other online judges (and real ACM contest servers) treat non-zero return as runtime error. I usually abort with #define FAIL *(int*)0 = 0 causes CRASH runtime error |
|
|