Kay1209 @ 2019-02-20 19:44:04
#include<iostream>
#include<cmath>
using namespace std;
int su(int x)
{
for (int i=2;i<=sqrt(x);i++)
if (x%i==0)
return 1;
return 0;
}
int main()
{
int n,n1,n2,n3,flag;
cin>>n;
for(n1=2;n1<n-4;n1++)
{
for(n2=2;n2<n-4;n2++)
if(su(n1)+su(n2)==0)
{
n3=n-n1-n2;
if(su(n3)||n3<0)
continue;
cout<<n1<<" "<<n2<<" "<<n3;
flag=1;
break;
}
if(flag)
break;
}
return 0;
}
本地没问题,但就是上传WA
by AC_Dolphin @ 2019-02-21 18:01:06
@Kay1209 。。。