1. 已知公鸡5元一只,母鸡3元一只,小鸡三只一元,问花100元买100只,应各有几只?
static void Main(string[] args)
{
int i, j, k, s = 100;
for (i = 1; i < 20; i++)
{
for (j = 1; j < 33; j++)
{
for (k = 1; k < 300; k++)
{
if (s == 5 * i + 3 * j +k/3 && k%3==0)
{
if (s == i + j + k)
{
Console.WriteLine(i + "gongji " + j + "muji " + k + "xiaoji");
}
}
}
}
}
}