花落丶子不语 @ 2019-07-09 22:22:36
#include<iostream>
using namespace std;
const int p[2262]{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59(……内容太长,截肢)};
int main()
{
int n;
cin>>n;
for(int i=1;i<=2262;i++)
for(int j=1;j<=2262;j++)
for(int k=1;k<=2262;k++)
if(p[i]+p[j]+p[k]==n){cout<<p[i]<<" "<<p[j]<<" "<<p[k];return 0;}
return 0;
}
#4 #5 #8
by 嘟嘟cqy @ 2019-07-11 12:04:20
@花落丶Refuser 您的i是不是应该从0开始计数???
by 嘟嘟cqy @ 2019-07-11 12:08:11
不然的话岂不是取不到2???
by 花落丶子不语 @ 2019-07-11 20:09:08
@嘟嘟cqy 。。。我好像没试过。。。
by 花落丶子不语 @ 2019-07-11 20:10:25
@嘟嘟cqy 已AC 3Q
by 嘟嘟cqy @ 2019-07-11 20:23:44
@花落丶Refuser 不谢