Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- class number{
- int x , y;
- public:
- number(){x = 0, y = 0;}
- void input(){ cin >> x >> y;}
- void set (int a , int b)
- {
- x = a , y = b;
- }
- bool operator > (number ob)
- {
- return x + y > ob.x + ob.y;
- }
- bool operator < (number ob)
- {
- return x +y < ob.x + ob.y;
- }
- bool operator == (number ob)
- {
- return (x +y) == (ob.x + ob.y);
- }
- };
- int main()
- {
- number n1 ,n2 , n3;
- n1.input();
- n2.input();
- if(n1 > n2)
- printf("N1 is greater then N2\n");
- else if(n1 < n2)
- printf("N2 is greater then N1\n");
- else if(n1 == n2)
- printf("Twice are same\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement