这段程序有无错误?

来源:百度知道 编辑:UC知道 时间:2024/05/05 22:08:52
#include<stdio.h>
void main()
{
int max(int x,int y,int z);
int a,b,c,e;
scanf("%d,%d,%d",&a,&b,&c);
e=max(a,b,c);
printf("max=%d\n",e);}

int max(int x,int y,int z);
{ int g;
if(x>y>z) g=x;
else if(y>x>z) g=y;
else g=z;
return g;
}

#include<stdio.h>
int max(int x,int y,int z)
{
int g,temp1;
if(x>y)
temp1=x;
else
temp1=y;
if(temp1>z)
g=temp1;
else
g=z;
return g;
}
void main()
{
int a,b,c,e;
scanf("%d%d%d",&a,&b,&c);
e=max(a,b,c);
printf("max=%d\n",e);
}
有一些错 我改了下 你看看