解题思路:
注意事项:
参考代码:#include <stdio.h>
int main ()
{
int cock,hen,chicken;
for (cock = 0;cock < 20;cock++)
{
for (hen = 0;hen < 33;hen++)
{
chicken = 100 - cock - hen;
if((5 * cock + 3 * hen + chicken / 3 == 100)&&chicken % 3 == 0)
printf ("cock=%d,hen=%d,chicken=%d\n",cock,hen,chicken);
}
}
}
0.0分
0 人评分