题目地址:http://ac.jobdu.com/problem.php?cid=1040&pid=82
//九度OJ 教程83 百鸡问题
//http://ac.jobdu.com/problem.php?cid=1040&pid=82
#include <stdio.h>
int main()
{
int n,x,y,z;
while(~scanf("%d",&n))
{
n*=3;
for(x=0;x<=100;x++)
{
for(y=0;y<=100-x;y++)
{
z=100-x-y;
if(z<0||(15*x+9*y+z)>n)break;
printf("x=%d,y=%d,z=%d\n",x,y,z);
}
}
}
return 0;
}