P1304 哥德巴赫猜想 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
#include<bits/stdc++.h>
using namespace std;
struct student
{
string name;
int c,m,e,s;
};
bool check(int n)
{
for(int i=2;i*i<=n;i++)
{
if(n%i==0)return 0;
}
return 1;
}
void out(int n)
{
for(int i=2;i<=n;i++)
{
if(check(i)&&check(n-i))
{
cout<<n<<'='<<i<<'+'<<n-i<<endl;
break;
}
}
}
int main()
{
int n;cin>>n;int cnt=0;
for(int i=4;i<=n;i+=2)
{
out(i);
}
return 0;
}