编写重载函数Max可分别求取两个整数,三个整数,两个双精度数,三个双精度数的最大值。


#include<御物stdio.h>
int max(int a,int b)
{
return a>镇胡液b?a:b;
}
int max(int a,int b,int c)
{
return max(a,max(b,c));
}
double max(double a,double b)
{
return a>b?a:b;
}
double max(double a,double b,double c)
{
return max(a,max(b,c));
}
void main()
{
int a,b,c;
double x,y,z;
printf("input three int:");
scanf("%d%d%d",&a,&b,&c);
printf("input three double:");
scanf("%lf%lf%lf",&x,&y,&z);
printf("max(a,b)=%d max(a,b,c)=%d\n",max(a,b),max(a,b,c));
printf("做让max(x,y)=%lf max(x,y,z)=%lf\n",max(x,y),max(x,y,z));
}