Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91414 | 只因你太美(Ikun 真爱粉) | 哥德巴赫猜想 | C++ | Wrong Answer | 2 MS | 256 KB | 690 | 2024-09-21 17:53:46 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; bool a(int n){ if(n<=1)return 0; for(int i=2;i*i<=n;i++){ if(n%i==0)return 0; } return 1; } int main(){ int n=6,m=100; // for(int j=3;j<=m;j++) for(int i=3;i<=m;i+=2){ if(a(n-i)&&a(i)){ if(n-i<=i) cout<<n<<"="<<n-i<<"+"<<i<<endl; else cout<<n<<"="<<i<<"+"<<n-i<<endl; n+=2; i-=2; } } return 0; }
------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 12=5+7 14=7+7 16=5+11 18=7+11 20=7+13 22=5+17 24=7+17 26=7+19 28=5+23 30=7+23 32=3+29 34=5+29 36=7+29 38=7+31 40=3+37 42=5+37 44=7+37 46=5+41 48=7+41 50=7+43 52=5+47 54=7+47 56=3+53 58=5+53 60=7+53 62=3+59 64=5+59 66=7+59 68=7+61 70=3+67 72=5+67 74=7+67 76=5+71 78=7+71 80=7+73 82=3+79 84=5+79 86=7+79 88=5+83 90=7+83 92=3+89 94=5+89 96=7+89