| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 130366 | 谭思宸 | 哥德巴赫猜想 | C++ | Accepted | 3 MS | 264 KB | 453 | 2025-09-13 11:37:33 |
#include<bits/stdc++.h> #include<iostream> using namespace std; int zs(int x) { if(x<2){ return 0; } for(int i=2; i*i<=x; i++) { if(x%i==0) { return 0; } } return 1; } int fenjie(int n){ for(int i=2;i<=n/2;i++){ if(zs(i)==1&&zs(n-i)==1&&i<=n-i){ cout << n << "=" << i << "+" << n-i <<endl; break; } } } int main() { for(int i=6;i<=100;i+=2){ fenjie(i); } return 0; }