#include<iostream.h>
template <class T>//函数模板 
 T add(T x,T y)//求两数之和
{
 T z;
 z=x+y;
 return(z);
}
 int main()
{
 int x1=1,y1(2);
 float x2=1.1,y2=2.2;
 cout<<"两个整数之和："<<add(x1,y1)<<endl;
 cout<<"两个浮点数之和："<<add(x2,y2)<<endl;
 cout<<"两个长整数之和："<<add<long>(x2,y2)<<endl;
 return(0); 
}