今天学的算法,,反复看了10几次都不是非常明白,,1整天算得我头都晕了,明天继续硬着头皮学下去吧,,记得有前辈说过学C贵在坚持,,学到后面不懂的问题自然就懂了!!
void 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++;
}
}
My life goal, senior programmer! 编程中国c/c++交流群:45146331 验证信息请输入:编程中国