C语言问题,求助,,自己编了一个程序,可编译的时候说类型错误,求指教

#include<stdio.h>
#include<stdlib.h>
int main()
{int i,k,a[10];
for(i=0;i<=9;i++)
{scanf("%d",&a[i]);
if(a[i]>a[0])
a[0]=a[i];
k=a[0];}
printf("%d",k);
system("pause");
}
#include<stdio.h>
#include<stdlib.h>
int main()
{ void max(int x,int y);
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
max(a,b);
max(a,c);
max(b,c);
printf("%d,%d,%d",a,b,c);
return ;
system("pause");
}
void max(int x,int y)
{ int x,y,r;
if(x<y)
{r=x;
x=y;
y=r;}
}
不好意思哈,,我想问的是这个程序

第1个回答  2015-01-30
你的主函数类型是int 所以在return后面加个int类型的返回,不返回的话可以写个0;
第2个回答  2015-01-30
max中重复定义了x,y
相似回答