online_judge_1045

#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;
}
原文地址:https://www.cnblogs.com/abc-24990/p/4257530.html