1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| #include <cstdio> int n,i=4; bool s[10000]={1,1};
inline void a(){ for (int j=2;j<10000;j++) for (int k=j*2;k<10000;k+=j) s[k]=1; } int main(void){ scanf ("%d",&n); a(); for (;i<=n;i+=2){ int j=2; for (;s[j]||s[i-j];j++);
printf ("%d=%d+%d\n",i,j,i-j); } }
|