c语言 比较三个数大小# include void main(){\x05int max(int x,int y,int z);\x05int a,b,c,d;\x05scanf("%d,%d,%d",&a,&b,&c);\x05d=max(a,b,c);\x05printf("max = %d\n",d);}int max(int x,int y,int z){\x05int m,int n;\x05if(x>y) m = x;\x05else m = y;

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 22:43:43
c语言比较三个数大小#includevoidmain(){\x05intmax(intx,inty,intz);\x05inta,b,c,d;\x05scanf("%d,%d,%d",&a,&b,&c

c语言 比较三个数大小# include void main(){\x05int max(int x,int y,int z);\x05int a,b,c,d;\x05scanf("%d,%d,%d",&a,&b,&c);\x05d=max(a,b,c);\x05printf("max = %d\n",d);}int max(int x,int y,int z){\x05int m,int n;\x05if(x>y) m = x;\x05else m = y;
c语言 比较三个数大小
# include
void main()
{
\x05int max(int x,int y,int z);
\x05int a,b,c,d;
\x05scanf("%d,%d,%d",&a,&b,&c);
\x05d=max(a,b,c);
\x05printf("max = %d\n",d);
}
int max(int x,int y,int z)
{
\x05int m,int n;
\x05if(x>y) m = x;
\x05else m = y;
\x05if(m>z) n = m;
\x05else n = z;
\x05return(n);
}
为什么最后输出的是a的值,而不是比较大小后的值呢?

c语言 比较三个数大小# include void main(){\x05int max(int x,int y,int z);\x05int a,b,c,d;\x05scanf("%d,%d,%d",&a,&b,&c);\x05d=max(a,b,c);\x05printf("max = %d\n",d);}int max(int x,int y,int z){\x05int m,int n;\x05if(x>y) m = x;\x05else m = y;
# include
void main()
{
\x09int max(int x,int y,int z);
\x09int a,b,c,d;
\x09scanf("%d%d%d",&a,&b,&c);
\x09d=max(a,b,c);
\x09printf("max = %d\n",d);
}
int max(int x,int y,int z)
{
\x09int m ,n;
\x09if(x>y) m = x;
\x09else m = y;
\x09if(m>z) n = m;
\x09else n = z;
\x09return(n);
}
你是不是输入格式有误啊?