方法一:
#include <stdio.h>
int main()
{
float a,b,c,t;
printf("输入a,b,c三个值,用,隔开\n");
scanf("%f,%f,%f",&a,&b,&c);
if(a<b)
{
t = a;
a = b;
b = t;
}
if(a<c)
{
t = a;
a = c;
c = t;
}
printf("三者中最大值%f",a);
return 0;
}
******************************************************************************************************
方法二:
#include <stdio.h>
int a,b,c;
int main()
{
int max(int a,int y,int z);
scanf("%d,%d,%d",&a,&b,&c);
int z=max(a,b,c);
printf("max=%d\n",z);
return 0;
}
int max(int x,int y,int z)
{
int max;
if(x>y) max=x;
else max=y;
if(max<c) max=c;
return (max);
}