#include#define M 100int main(){ int n,x,y,z; while(scanf("%d",&n)!=EOF) { for(x=0;x<=M;x++) for(y=0;y<=M;y++) for(z=0;z<=M;z++) { if(15*x+9*y+z<=3*n&&x+y+z==M) printf("x=%d,y=%d,z=%d\n",x,y,z); } } return 0;}
本文共 297 字,大约阅读时间需要 1 分钟。
#include#define M 100int main(){ int n,x,y,z; while(scanf("%d",&n)!=EOF) { for(x=0;x<=M;x++) for(y=0;y<=M;y++) for(z=0;z<=M;z++) { if(15*x+9*y+z<=3*n&&x+y+z==M) printf("x=%d,y=%d,z=%d\n",x,y,z); } } return 0;}
转载于:https://www.cnblogs.com/abc-24990/p/4257530.html