Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164942 邓弘锐 哥德巴赫猜想 C++ Accepted 3 MS 260 KB 410 2026-11-08 13:10:54

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int a(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(a(i)==1&&a(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; }