I've used two compilers: G++ on prompt and Dev-c and in both of them i get the right answer while the it keeps saying I'm wrong. I submitted as GNU C++ it said wrong on test 5, then i submit the same code as MS C++ it says wrong in test 9 but in both tests i tested here and got the right answer... any tips?
1) First of all, you should fix these compiler warnings:
2) With GCC and
-fstack-protector-all
, I get an error on test 5:This means that your program corrupts the stack somewhere and that you should revise your memory operations. I suggest to use
string
instead ofchar[]
everywhere.P.S. Please don't use Dev-C++, it is not maintained and ships with a very old C++ compiler. You can try Visual C++ Express or MinGW with Code::Blocks instead.
Oh, thank you. I don't use Dev-C, except when i have problems in gcc. I'll download Code::blocks and see what i get. :)