再来看看
template <class T>T max(T x,T y)
#include <iostream.h>
{
return(x>y)?(x):(y);
}
double max(double ,double);//重载了一个double类的函数为什么这一个题还是不能运行
void main()
{
int x=3,y=4;
long l=5;
double a=1.1,b=3.4;
cout<<max(x,y)<<endl;//调用int max(int ,int)
cout<<max(a,b)<<endl;//调用double max(double ,double)
cout<<max(l,a)<<endl;//调用double max(double ,double)
cout<<max(a,l)<<endl;//调用double max(double ,double)
cout<<max(x,l)<<endl;//调用double max(double ,double)
}