Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3127 莫业祁 哥德巴赫猜想 C++ Compile Error 0 MS 0 KB 439 2024-04-05 19:32:43

Tests(0/0):


Code:

# include<iostream> using namespace std; int Prime_number(int n){ if(n==0||n==1) return 1; for(int i=2;i<=sqrt(n);i++){ if(n%i==0) return 1; } return 0; } int main(){ for(int i=6;i<=m;i+=2){ for(int j=2;j<=i;j++){ if(Prime_number(j)&&Prime_number(i-j)){ cout<<i<<"="<<j<<"+"<<i-j<<endl; } } } return 0; }


Run Info:

Main.cc: In function 'int Prime_number(int)':
Main.cc:5:26: error: 'sqrt' was not declared in this scope
     for(int i=2;i<=sqrt(n);i++){
                          ^
Main.cc: In function 'int main()':
Main.cc:11:20: error: 'm' was not declared in this scope
     for(int i=6;i<=m;i+=2){
                    ^