Runtime Error (NZEC) in simple code

前端 未结 6 1136
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 05:41

I\'m getting runtime error (NZEC) when running the following code over at SPOJ. I\'d be very thankful if any of you would kindly point out what\'s going on.

         


        
6条回答
  •  无人及你
    2020-12-11 06:16

    I don't know what java returns when the main function is void, but this can be the reason of this error message. Spoj also checks the return value of your program, and it expects 0 (success/non-error code). I guess changing your main function to return 0 will fix this error message.

    I just had this same error with a C program, and adding a return 0 changed the error to accepted.

提交回复
热议问题