没注释的源代码
#include <iostream>
using namespace std;
int max(int a,int b,int c);
double max(double a,double b,double c);
long max(long a,long b,long c);
int main()
{
int a,b,c;
double x,y,z;
long m,n,p;
cout<<"请输入三个整数:";
cin>>a>>b>>c;
cout<<"三个整数的最大值是:"<<max(a,b,c)<<endl;
cout<<"请输入三个浮点数:";
cin>>x>>y>>z;
cout<<"三个浮点数的最大值是:"<<max(x,y,z)<<endl;
cout<<"请输入三个长整数:";
cin>>m>>n>>p;
cout<<"三个长整数的最大值是:"<<max(m,n,p)<<endl;
return 0;
}
int max(int a,int b,int c)
{
if(b>a) a=b;
if(c>a) a=c;
return a;
}
double max(double a,double b,double c)
{
if(b>a) a=b;
if(c>a) a=c;
return a;
}
long max(long a,long b,long c)
{
if(b>a) a=b;
if(c>a) a=c;
return a;
}