完善程序: (哥德巴赫猜想)哥德巴赫猜想是指,任一大于 2 的偶数都可写成两个质数之和。 迄今为止,这仍然是一个著名的世界难题,被誉为数学王冠上的明珠。试编写程 序,验证任一大于 2 且不超过 n 的偶数都能写成两个质数之和。
#include<bits/stdc++.h>
using namespace std;
int main(){
const int SIZE=1000;
int n,r,p[SIZE],ans;
bool tmp;
cin>>n;
r=1;
p[1]=2;
for(int i=3;i<=n;i++){
①;
for(int j=1;j<=r;j++){
if(i%②==0){
tmp=false;
break;
}
}
if(tmp){
r++;
③;
}
}
ans=0;
for(int i=2;i<=n/2;i++){
tmp=false;
for(int j=1;j<=r;j++){
for(int k=j;k<=r;k++){
if(i+i==④){
tmp=true;
break;
}
}
}
}
if(tmp){
ans++;
}
cout<<ans<<endl;
}
这程序是什么思路啊!