Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3081 孙浚轩 哥德巴赫猜想 C++ Wrong Answer 1 MS 256 KB 448 2024-03-30 23:20:09

Tests(0/1):


Code:

#include<iostream> using namespace std; int o[51]={}; bool isprime(int n){ if(n<=1) return 0; for(int i=2;i<=n/i;i++) if(n%i==0) return 0; return 1; } int main(){ for(int i=1;i<=50;i++) o[i]=i*2; for(int I=3;I<=50;I++){ for(int i=3;i<=43;i++){ int j=o[I]-i; if(isprime(i)&&isprime(j)&&i<=j) cout<<o[I]<<"="<<i<<"+"<<j<<endl; } } 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=3+5 10=3+7 10=5+5 12=5+7 14=3+11 14=7+7 16=3+13 16=5+11 18=5+13 18=7+11 20=3+17 20=7+13 22=3+19 22=5+17 22=11+11 24=5+19 24=7+17 24=11+13 26=3+23 26=7+19 26=13+13 28=5+23 28=11+17 30=7+23 30=11+19 30=13+17 32=3+29 32=13+19 34=3+31 34=5+29 34=11+23 34=17+17 36=5+31 36=7+29 36=13+23 36=17+19 38=7+31 38=19+19 40=3+37 40=11+29 40=17+23 42=5+37 42=11+31 42=13+29 42=19+23 44=3+41 44=7+37 44=13+31 46=3+43 46=5+41 46=17+29 46=23+23 48=5+43 48=7+41 48=11+37 48=17+31 48=19+29 50=3+47 50=7+43 50=13