Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95757 任斌 哥德巴赫猜想 C++ Wrong Answer 3 MS 256 KB 352 2024-11-02 10:43:32

Tests(0/1):


Code:

#include<bits/stdc++.h> using namespace std; bool ss(int s){ if(s<=1) return false; for(int i=2;i<sqrt(s);i++){ if(s%i==0) return false; } return true; } int main() { for(int i=6;i<=100;i++){ for(int j=2;j<=i/2;j++){ if(ss(j) && ss(i-j)) { cout<<i<<"="<<j<<"+"<<i-j<<endl; break; } } } 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=2+4 7=2+5 8=3+5 9=2+7 10=3+7 11=2+9 12=3+9 13=2+11 14=3+11 15=2+13 16=3+13 17=4+13 18=5+13 19=2+17 20=3+17 21=2+19 22=3+19 23=4+19 24=5+19 25=2+23 26=3+23 27=2+25 28=3+25 29=4+25 30=5+25 31=2+29 32=3+29 33=2+31 34=3+31 35=4+31 36=5+31 38=7+31 39=2+37 40=3+37 41=4+37 42=5+37 43=2+41 44=3+41 45=2+43 46=3+43 47=4+43 48=5+43 49=2+47 50=3+47 51=2+49 52=3+49 53=4+49 54=5+49 55=2+53 56=3+53 57=4+53 58=5+53 60=7+53 61=2+59 62=3+59 63=2+61 64=3+61 65=4+61 66=5+61 68=7+61 69=2+67 70=3+67 71=4+67 72=5+67