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;
    }
};
int main()
{
    Point p1(10, 6);
    Point p2(2, 2);

    p1 = p2;
    p1.print();
    return 0;
}