提交记录 #287

提交时间:2024-11-19 19:49:01
语言:c 状态:CompileError
编译情况:编译错误
code.c: In function ‘isPrime’:
code.c:5:24: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
    5 |     if (n <= 1) return 0;
      |                        ^
code.c:4:6: note: declared here
    4 | void isPrime(int n) {
      |      ^~~~~~~
code.c:6:24: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
    6 |     if (n == 2) return 1;
      |                        ^
code.c:4:6: note: declared here
    4 | void isPrime(int n) {
      |      ^~~~~~~
code.c:7:28: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
    7 |     if (n % 2 == 0) return 0;
      |                            ^
code.c:4:6: note: declared here
    4 | void isPrime(int n) {
      |      ^~~~~~~
code.c:10:32: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
   10 |         if (n % i == 0) return 0;
      |                                ^
code.c:4:6: note: declared here
    4 | void isPrime(int n) {
      |      ^~~~~~~
code.c:12:12: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
   12 |     return 1;
      |            ^
code.c:4:6: note: declared here
    4 | void isPrime(int n) {
      |      ^~~~~~~
code.c: In function ‘isPalindrome’:
code.c:21:20: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
   21 |             return 0;
      |                    ^
code.c:15:6: note: declared here
   15 | void isPalindrome(int n){
      |      ^~~~~~~~~~~~
code.c:24:12: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
   24 |     return 1;
      |            ^
code.c:15:6: note: declared here
   15 | void isPalindrome(int n){
      |      ^~~~~~~~~~~~
code.c: In function ‘main’:
code.c:30:12: error: void value not ignored as it ought to be
   30 |         if(isPrime(i)){
      |            ^~~~~~~
code.c:31:16: error: void value not ignored as it ought to be
   31 |             if(isPalindrome(i)){
      |                ^~~~~~~~~~~~
固定测试点暂不可用
... 等待中
time N/A
memory N/A
附加测试点暂不可用
... 不可用
time N/A
memory N/A
京ICP备2024093084 号