没注释的源代码
#include <iostream>
using namespace std;
template<typename T>
T max(T a,T b,T c)
{
if(b>a) a=b;
if(c>a) a=c;
return a;
}
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;
}