Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- class Point{
- private:
- int x, y;
- public:
- Point() {}
- Point(int _x, int _y) {
- x = _x;
- y = _y;
- }
- bool operator < (Point p) {
- if(x < p.x and y < p.y) {
- return true;
- }
- return false;
- }
- bool operator > (Point p) {
- if(x > p.x and y > p.y) {
- return true;
- }
- return false;
- }
- void print() {
- cout << x << " " << y << endl;
- }
- };
- int main()
- {
- Point p1(1, 3);
- Point p2(2, 5);
- if(p2 > p1) {
- cout << "Bigger" << endl;
- }
- else {
- cout << "NOT" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement