Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class point
- {
- int x,y;
- public:
- point()
- {
- x=y=0;
- }
- point(int a,int b)
- {
- x=a;
- y=b;
- }
- void display()
- {
- cout<<"point("<<x<<","<<y<<")"<<endl;
- }
- point operator+(point right)
- {
- }
- point operator-(point right)
- {
- }
- point operator*(int)
- {
- }
- bool operator>(point right)
- {
- }
- point operator++(){
- }
- point operator++(int){
- }
- };
- int main()
- {
- point p(3,9),q(2,7),r;
- r=p+q;
- r.display();
- if(p>q)
- {
- r=p-q;
- r.display();
- }
- else
- {
- r=q-p;
- r.display();
- }
- p++;
- p.display();
- ++p;
- p.display();
- q=q*2;
- q.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement