#include<iostream>
#include<string>
using namespace std;
template<typename T>
T less(T a,T b)
{
if(a>b)return b;
else return a;
}
int main()
{
double a=5.6,b=7.2;
cout<<"the less of the two is:"<<less(a,b)<<endl;
system("pause");
return 0;
}
你看看吧,我在dev下面调试不行,在VC下面就可以