Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- ~Point() {}
- 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;
- }
- void print() {
- cout << x << " " << y << endl;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement