//公鸡2文,母鸡1文,小鸡半文;100文,买100只鸡;
int n = 0;
for (int i = 1; i < 100/2; i++)
{
for (int i1 = 1; i1 < 100; i1++)
{
for (int i2 = 1; i2 < 100/0.5; i2++)
{
if (i*2+i1+i2*0.5==100&&i+i1+i2==100)
{
Console.WriteLine(i+"只公鸡"+i1+"只母鸡"+i2+"只小鸡");
n++;
}
}
}
}
Console.WriteLine("总共有"+n+"种可能");
Console.ReadKey();