百钱百鸡
#include<iostream>
using namespace std;
int main()
{
cout<<" 公鸡 "<<"母鸡 "<<"小鸡"<<endl; //定义三个整形变量x(公鸡),y(母鸡),z(小鸡)
int x,y,z;
int i=0;
for(x=0;x<=20;x++) //循环语名for
for(y=0;y<=33;y++)
for(z=0;z<=100;z+=3)
{
if(5*x+3*y+z/3==100&&x+y+z==100) //满足100元买100只鸡
{
i++;
cout<<"☆"<<"方案"<<i<<"☆ "<<x<<" "<<y<<" "<<z<<endl;
}
}
return 0;
} //注解什么的不知道怎么写啊怎么写