#include<stdio.h> #define M 100 int 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 ",x,y,z); } } return 0; }
#include<stdio.h> #define M 100 int 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 ",x,y,z); } } return 0; }