编了个c语言程序编译没问题,组建时fatal error LNK1169: one or more multiply defined symbols found

2025-02-24 07:34:12
推荐回答(2个)
回答1:

#include
void main()//main得有类型 你忘了
{
float ave(int x,int y,int z) ;//你没声明函数
int a,b,c,p;
scanf("%d%d%d",&a,&b,&c);
p=ave(a,b,c); printf("%d\n",p);
}
float ave(int x,int y,int z)
{
float t;
t=(x+y+z)/3.0;
return(t);
}

好了 这样就可以了啊 你要学会看出错的注释 希望你学习进步

回答2:

请及时采纳

#include
float ave(int x,int y,int z) ; //函数要声明
void main()
{ int a,b,c,p;
scanf("%d%d%d",&a,&b,&c);
p=ave(a,b,c);
printf("%d\n",p); }
float ave(int x,int y,int z)
{ float t;
t=(x+y+z)/3.0;
return(t); }