C++重载输入流

#include <bits/stdc++.h>

using namespace std;

struct Point {
    int x, y;
    Point(int xx, int yy):x(xx), y(yy) {}
    Point():x(0), y(0) {}
    friend ostream& operator << (ostream &os, const Point & p) {
        os << "[" << p.x << " " << p.y << "]";
    }
    friend istream& operator >> (istream &is,Point &p) {
        is >> p.x >> p.y;
    }
} a;

int main()
{
    cin >> a;
    cout << a << endl;
    return 0;
}