Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
8434 刘逸杭 哥德巴赫猜想 C++ Wrong Answer 0 MS 268 KB 415 2025-12-21 10:15:02

Tests(0/1):


Code:

#include<bits/stdc++.h> using namespace std; bool f1(int n){ if(n<2) return 0; for(int i=2;i<=sqrt(n);i++) if(n%i==0) return 0; return 1; } void f2(int n){ for(int i=n-1;i>0;i--){ if(f1(i)&&f1(n-i)){ cout<<n<<'='<<i<<'+'<<n-i<<endl; break; } } } int main(){ for(int i=6;i<=100;i+=2){ f2(i); } return 0; }


Run Info:

------Input------
0
------Answer-----
6=3+3 8=3+5 10=3+7 12=5+7 14=3+11 16=3+13 18=5+13 20=3+17 22=3+19 24=5+19 26=3+23 28=5+23 30=7+23 32=3+29 34=3+31 36=5+31 38=7+31 40=3+37 42=5+37 44=3+41 46=3+43 48=5+43 50=3+47 52=5+47 54=7+47 56=3+53 58=5+53 60=7+53 62=3+59 64=3+61 66=5+61 68=7+61 70=3+67 72=5+67 74=3+71 76=3+73 78=5+73 80=7+73 82=3+79 84=5+79 86=3+83 88=5+83 90=7+83 92=3+89 94=5+89 96=7+89 98=19+79 100=3+97
------Your output-----
6=3+3 8=5+3 10=7+3 12=7+5 14=11+3 16=13+3 18=13+5 20=17+3 22=19+3 24=19+5 26=23+3 28=23+5 30=23+7 32=29+3 34=31+3 36=31+5 38=31+7 40=37+3 42=37+5 44=41+3 46=43+3 48=43+5 50=47+3 52=47+5 54=47+7 56=53+3 58=53+5 60=53+7 62=59+3 64=61+3 66=61+5 68=61+7 70=67+3 72=67+5 74=71+3 76=73+3 78=73+5 80=73+7 82=79+3 84=79+5 86=83+3 88=83+5 90=83+7 92=89+3 94=89+5 96=89+7 98=79+19 100=97+3