Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
84229 | 游四鑫 | 哥德巴赫猜想 | C++ | Accepted | 2 MS | 256 KB | 379 | 2024-07-15 14:32:31 |
#include<iostream> #include<cmath> using namespace std; int x(int n){ for(int v=2;v<=sqrt(n);v++){ if(n%v==0){ return 0; } } return 1; } int main(){ int s=0; for(int i=6;i<=100;i=i+2){ for(int j=3;j<=i/2;j=j+2){ s=i-j; if(x(j)&&x(s)){ cout<<i<<'='<<j<<'+'<<s<<endl; break; } } } return 0; }