#include<iostream.h>
 struct S //结构体类型
{
  int a;
  int b;
};
template <class T>//类模板
 class data 
{
 public:
  data(T x);
  T get(void);
 private:
  T d;
};
template <class T>
data <T>::data(T x)
{
  d=x;
}
template <class T>
T data <T>::get(void)
{
  return(d);
}
int main()
{
 int x1=5;
 float x2=3.7;
 S x3={1,2};
 data <int> t1(x1);
 data <float> t2(x2);
 data <S> t3(x3);
 cout<<t1.get()<<endl;
 cout<<t2.get()<<endl;
 cout<<t3.get().a<<" "<<t3.get().b<<endl;
 return(0);
}