#include<bits/stdc++.h>
using namespace std;
template<class T>
class Point{
private :
T a_,b_;
public:
Point():a_(0),b_(0) {}
Point(Point& rhs){ *this=rhs; }
friend istream& operator >> (istream& in,Point& rhs){
in>>rhs.a_>>rhs.b_;
return in;
}
friend ostream& operator << (ostream& out,Point& rhs){
out<<rhs.a_<<" "<<rhs.b_;
return out;
}
};
int main()
{
Point<int> S;
cin>>S;
cout<<S;
return 0;
}
c++泛型
最新推荐文章于 2025-02-26 14:22:41 发布