用win-tc运行这个百钱买百鸡的程序,总是提示需要逻辑0或者非0在main函数中,请高手指点下,哪里出问题了?
#include<stdio.h>main(){intcocks=0,hens,chicks;while(cocks<=19){hens=0;while(hens<=33...
#include<stdio.h>
main()
{
int cocks=0,hens,chicks;
while(cocks<=19)
{ hens=0;
while(hens<=33)
{chicks=100-cocks-hens;
if(5.0*cocks+3.0*hens+chicks/3.0=100.0)
printf("%d %d %d\n",cocks,hens,chicks);
hens++;
}
cocks++;
}
getch();
} 展开
main()
{
int cocks=0,hens,chicks;
while(cocks<=19)
{ hens=0;
while(hens<=33)
{chicks=100-cocks-hens;
if(5.0*cocks+3.0*hens+chicks/3.0=100.0)
printf("%d %d %d\n",cocks,hens,chicks);
hens++;
}
cocks++;
}
getch();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询