求教问题函数模板??
#include<iostream.h>template<typename t>
t max1(t a,t b)
{return(a>b)?a:b;}
t max1(t a,t b,t c)
{return(a>b?a:b)>c?(a>b?a:b):c;}
void main()
{int a=1,b=3,c=12;
float a1=1.2,b1=3.2,c1=12.2;
cout<<"max is "<<max1(a,b)<<max1(a,b,c);
cout<<"max is "<<max1(a1,b1)<<max1(a1,b1,c1);
}