CCCPaste

Untitled

#include 
using namespace std;

class Point {
private:
    int x, y; 

public: 
    Point() {}
    Point(int _x, int _y) {
        x = _x;
        y = _y;
    }
    Point(const Point & tmp) {
        x = tmp.x;
        y = tmp.y;
    }

    int get_x() {
        return x;
    }
    int get_y() {
        return y;
    }

    void set_x(int _x) {
        x = _x;
    }
    void set_y(int _y) {
        y = _y;
    }

    Point operator + (Point tmp) {
        Point res(x + tmp.x, y + tmp.y);
        return res;
    }
    Point operator - (Point tmp) {
        Point res(x - tmp.x, y - tmp.y);
        return res;
    }
    Point operator * (Point tmp) {
        Point res(x * tmp.x, y * tmp.y);
        return res;
    }
    Point operator / (Point tmp) {
        Point res(x / tmp.x, y / tmp.y);
        return res;
    }
    
    
    bool operator < (Point tmp) {
        if(x < tmp.x) {
            return true;
        }
        else {
            return false;
        }
    }
    
    bool operator <= (Point tmp) {
        if(x <= tmp.x) {
            return true;
        }
        else {
            return false;
        }
    }
    
    bool operator > (Point tmp) {
        if(x > tmp.x) {
            return true;
        }
        else {
            return false;
        }
    }
    
    bool operator >= (Point tmp) {
        if(x >= tmp.x) {
            return true;
        }
        else {
            return false;
        }
    }
    
    bool operator == (Point tmp) {
        if(x == tmp.x && y == tmp.y) {
            return true;
        }
        else {
            return false;
        }
    }
    
    bool operator != (Point tmp) {
        if(x == tmp.x and y == tmp.y) {
            return false;
        }
        else {
            return true;
        }
    }
    
    Point & operator += (Point tmp) {
        x += tmp.x;
        y += tmp.y;
        return *this;
    }
    
    Point & operator -= (Point tmp) {
        x -= tmp.x;
        y -= tmp.y;
        return *this;
    }
    
    Point & operator *= (Point tmp) {
        x *= tmp.x;
        y *= tmp.y;
        return *this;
    }
    Point & operator /= (Point tmp) {
        x /= tmp.x;
        y /= tmp.y;
        return *this;
    }
    
    Point & operator = (Point tmp) {
        x = tmp.x;
        y = tmp.y;
        return *this;
    }
    void print() {
        cout << x << " " << y << endl;
    }
     friend ostream & operator << (ostream & stream, Point & tmp);
    friend istream & operator >> (istream & stream, Point & tmp);
};


ostream & operator << (ostream & stream, Point & tmp) {
    stream << tmp.x << " " << tmp.y << endl;
    return stream;
}
istream & operator >> (istream & stream, Point & tmp) {
    stream >> tmp.x >> tmp.y;
    return stream;
}

int main()
{
    Point p1;
    Point p2;
    
    cin >> p1;
    cin >> p2;

    p1 += p2;
    
    cout << p1 << endl;
    return 0;
}