这段代码运行不了是什么原因呢?
#include <iostream>using namespace std;
class point
{int x,y;
public:point(int x1=0,int y1=0):x(x1),y(y1){}
friend ostream& operator<<(ostream&, const point&);
friend istream& operator>>(istream&,point&);
};
ostream& operator<<(ostream& out, const point& src)
{ out<<'<'<<src.x<<','<<src.y<<'>';
return out;
}
istream& operator>>(istream& in,point& target)
{ in>>target.x>>target.y;
return in;
}
int main()
{point a(1,2);
cin>>a;
cout<<a;
return 0;
}