#include <iostream>
using namespace std;
template<class T>
T getmax(T a,T b)
{
return(a>b?a:b);
}
void main()
{
int a=5,b=6;
float c=7.5,d=7.2;
cout<<getmax(a,b)<<endl;
cout<<getmax(c,d)<<endl;
getchar();
}
C++模版的使用
最新推荐文章于 2024-07-27 14:22:20 发布