Run ID:57
提交时间:2022-07-18 03:21:19
#include<iostream> using namespace std; int main(){ int n,x,y,z,k=0; cin>>n; for(x=0;x<=n;x++) { for(y=0;y<=n;y++) { for(z=0;z<=n;z++) { if(x+y+z==n&&(5*x+3*y+z/3)==n&&z%3==0) { k++; cout<<k<<":"<<x<<","<<y<<","<<z<<endl; } } } } if(k==0) { cout<<"None"; } return 0; }