#include <iostream>
using namespace std;
class position{
public:
position(int m,int n);
friend ostream & operator <<(ostream & out,const position & s);
friend istream & operator >>(istream & in,position & s);
int x;
int y;
};
void main()
{
position m(3,4);
cout<<m<<endl;
cout<<"输入x,y\n";
cin>>m;
cout<<m<<endl;
}
position ::position(int m,int n) :x(m),y(n){}
ostream & operator<< (ostream & out,const position & s)
{
out<<"(" << s.x<<",";
out<<s.y << ")\n";
return out;
}
istream & operator>> (istream & in,position & s)
{
in>>s.x;
in>>s.y;
return in;
}
using namespace std;
class position{
public:
position(int m,int n);
friend ostream & operator <<(ostream & out,const position & s);
friend istream & operator >>(istream & in,position & s);
int x;
int y;
};
void main()
{
position m(3,4);
cout<<m<<endl;
cout<<"输入x,y\n";
cin>>m;
cout<<m<<endl;
}
position ::position(int m,int n) :x(m),y(n){}
ostream & operator<< (ostream & out,const position & s)
{
out<<"(" << s.x<<",";
out<<s.y << ")\n";
return out;
}
istream & operator>> (istream & in,position & s)
{
in>>s.x;
in>>s.y;
return in;
}