c语言:百元白鸡问题

#include<stdio.h>
#include<math.h>
int main()
{
 //设公鸡,母鸡,鸡仔各x,y,z只;
 int x,y,z;
 for(x=0;x<=20;x++)
 {
  for(y=0;y<=33;y++)
  {
   for(z=3;z<=300;z+=3)
   {
    if(((x+y+z)==100)&&((5*x+3*y+z/3)==100))
    {
     printf("%d,%d,%d ",x,y,x);
    }
   }
  }
 }
 return 0;
}

原文地址:https://www.cnblogs.com/devil-angele/p/3581023.html