Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- class TT
- {
- public:
- int n;
- int operator <(TT &a)
- {
- if(this->n > a.n) return 1;
- else return 0;
- }
- int operator +(TT &a)
- {
- return this->n + a.n;
- }
- };
- /////////////////////////////////////////////////////////
- int main()
- {
- TT t1, t2;
- t1.n = 91;
- t2.n = 7;
- int nRes = t1<t2;
- printf("%d\n", nRes);
- printf("%d\n", t1+t2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement