Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <cmath>
- #include <iostream>
- using namespace std;
- class Point
- {
- private:
- int x_;
- int y_;
- public:
- void setXY(int x, int y) { x_ = x; y_ = y; }
- void setX(int x) { x_ = x; }
- void setY(int y) { y_ = y; }
- void show(int x, int y) { cout << getX(); cout << " " << getY(); }
- int getX() const { return x_; }
- int getY() const { return y_; }
- friend double getDistance(int x1, int y1, int x2, int y2); // (Point a, Point b)
- bool isEqual(int x1, int y1, int x2, int y2)
- {
- if (x1 == x2 && y1 == y2)
- return true;
- return false;
- }
- Point() { x_ = 0; y_ = 0; };
- Point(int x, int y) { x_ = x; y_ = y; };
- Point(const Point &ob) { x_ = ob.x_; y_ = ob.y_; };
- ~Point() { cout << endl << "Destructed" << endl; };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement