
同样一段代码,在Wintc上可以运行,vc6.0则不行,求解释
#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*cocks+3*hens+chicks/3==100)&&(chicks%3==0))
printf("%d %d %d\n",cocks,hens,chicks);
hens++;
}
cocks++;
}
}
--------------------Configuration: myster - Win32 Debug--------------------
Linking...
test.obj : error LNK2005: _main already defined in 1.obj
Debug/myster.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.
myster.exe - 1 error(s), 0 warning(s) 展开
main()
{
int cocks=0,hens,chicks;
while(cocks<=19)
{
hens=0;
while(hens<=33)
{
chicks=100-cocks-hens;
if ((5*cocks+3*hens+chicks/3==100)&&(chicks%3==0))
printf("%d %d %d\n",cocks,hens,chicks);
hens++;
}
cocks++;
}
}
--------------------Configuration: myster - Win32 Debug--------------------
Linking...
test.obj : error LNK2005: _main already defined in 1.obj
Debug/myster.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.
myster.exe - 1 error(s), 0 warning(s) 展开
展开全部
一个工程只能有一个 .c 文件里 有 main函数,
(main函数 只能有一个)
请在FilleView 里 选中1.c 按delete ..............
(main函数 只能有一个)
请在FilleView 里 选中1.c 按delete ..............
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询