希望能多结交几个学C的朋友共同学习,多多交流,不达目标誓不罢休!
编程中国c/c++交流群:45146331
验证信息请输入:编程中国
[此贴子已经被作者于2007-9-12 16:22:32编辑过]
今天学的算法,,反复看了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++;
}
}
#include (stdio.h)错误提示返回行是这行..我确实不知道这行有什么地方出错了!!
int main(void)
{
int dogs;
printf("How many dogs do you have?\n");
scanf("%d",&dogs);
printf("i have %d dog!\n",dogs);
return 0;
}
哪位高手帮我看看这程序为什么错了,,我找不到解决的办法!!还有这句为什么需要1个&连接符号?
scanf("%d",&dogs);
错误提示:bad file name format in include directive!坏的文件名格式和错误的指令!
不知道格式和指令哪有错哦。。
[此贴子已经被作者于2007-9-9 17:34:35编辑过]