Advertisement
Guest User

Gulu :P

a guest
Jul 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4.  
  5. class point
  6. {
  7.  
  8. int x,y;
  9. public:
  10. point()
  11. {
  12. x=y=0;
  13. }
  14. point(int a,int b)
  15. {
  16. x=a;
  17. y=b;
  18. }
  19. void display()
  20. {
  21.  
  22. cout<<"point("<<x<<","<<y<<")"<<endl;
  23. }
  24. point operator+(point right)
  25. {
  26.  
  27. }
  28. point operator-(point right)
  29. {
  30.  
  31. }
  32. point operator*(int)
  33. {
  34.  
  35. }
  36. bool operator>(point right)
  37. {
  38.  
  39. }
  40. point operator++(){
  41. }
  42. point operator++(int){
  43. }
  44.  
  45.  
  46.  
  47. };
  48.  
  49. int main()
  50. {
  51.  
  52. point p(3,9),q(2,7),r;
  53. r=p+q;
  54. r.display();
  55.  
  56.  
  57. if(p>q)
  58. {
  59.  
  60.  
  61. r=p-q;
  62. r.display();
  63. }
  64. else
  65. {
  66.  
  67. r=q-p;
  68. r.display();
  69. }
  70. p++;
  71. p.display();
  72. ++p;
  73. p.display();
  74. q=q*2;
  75. q.display();
  76. return 0;
  77.  
  78.  
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement