标签:std stream 开始 ret ios name clu first ace
#include<iostream>
using namespace std;
//如果不会,不妨由会开始
//1~FIRST:
//int mmax(int a,int b)
//{
// return a>b?a:b;
//}
//2~SECOND:
// T mmax(T a,T b)
//{
// return a>b?a:b;
//}
//3~THIRD:
template<class T>
T mmax(T a,T b)
{
return a>b?a:b;
}
int main()
{
cout<<mmax(‘c‘,‘d‘)<<endl;
cout<<mmax(3,5)<<endl;
cout<<mmax(3.3,9.6)<<endl;
cout<<mmax<int>(3.3,9.6)<<endl;
cout<<mmax((int)3.3,(int)9.6)<<endl;
}
标签:std stream 开始 ret ios name clu first ace
原文地址:http://www.cnblogs.com/TogetherLaugh/p/6623511.html