ihan255 @ 2018-10-08 21:04:17
RT 代码:
#include<iostream>
using namespace std;
bool pd(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 i,j,n;
cin>>n;
for(i=2;i<=n;i++)
for(j=2;j<=n-i;j++)
if(pd(i)&&pd(j)&&pd(n-i-j)) {cout<<i<<" "<<j<<" "<<n-i-j;return 0;}
return 0;
}
by duoluoluo @ 2018-10-10 21:57:55
@wu55555 233333