Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
141499 翁思宸 哥德巴赫猜想 C++ Accepted 2 MS 260 KB 556 2025-12-26 18:23:38

Tests(1/1):


Code:

//1501 哥德巴赫猜想 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int use(int x){ if(x<2){ return 0; } for(int i=2;i*i<=x;i++){ if(x%i==0){ return 0; } } return 1; } int main(){ int a,b; for(int i=6;i<=100;i+=2){ for(a=2;a<=(i/2);a++){ b=i-a; if(use(a) && use(b)){ cout<<i<<"="<<a<<"+"<<b<<endl; break; } } } return 0; }