int x, y, z; //x:公鸡,y:母鸡,z:小鸡x = y = z = 0;
for(x=1;x<=100/5;x++)
for (y = 1; y <= 100 / 3; y++)
{
z = 100 - x - y;
if (z % 3 == 0 && 5 * x + 3 * y + z / 3 == 100)
goto end;
}
end: Console.WriteLine("cook={0},Hen={1},chick={2}",x,y,z);
Console.Read();