Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
91409 刘世杰 哥德巴赫猜想 C++ Compile Error 0 MS 0 KB 590 2024-09-21 17:46:05

Tests(0/0):


Code:

#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int s1(int num){ if(num < 2) return 0; for(int i = 2;i * i <= num;i++) { if(num % i == 0){ return 0; } } return 1; } int s2(int num){ for(int i = 2;i <= n / 2;i++){ if(s1(i) == 1 && s1(num - i) == 1 && i <= num - i){ cout << num << "=" << i << "+" << num - i << "\n"; break; } } } int main(){ for(int i = 6;i <= 100;i += 2) fenjie(i); return 0; }


Run Info:

Main.cc: In function 'int s2(int)':
Main.cc:17:24: error: 'n' was not declared in this scope
     for(int i = 2;i <= n / 2;i++){ 
                        ^
Main.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
Main.cc: In function 'int main()':
Main.cc:25:45: error: 'fenjie' was not declared in this scope
     for(int i = 6;i <= 100;i += 2)  fenjie(i); 
                                             ^