xotohop

перегрузка

Apr 22nd, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5.  
  6. class numbers
  7. {
  8.     private:
  9.         int x;
  10.         int y;
  11.     public:
  12.     int get_x(){return x;}
  13.     int get_y(){return y;}
  14.     bool get_equal(){return false;}
  15.     numbers(){cin >> x >> y;}
  16.     numbers operator + (numbers comparison)
  17.     {
  18.         int flag;
  19.         if (x > y && x != y)
  20.             get_y();
  21.         else if (x < y && x != y)
  22.             get_x();
  23.         else
  24.             get_equal();
  25.     }
  26. };
  27.  
  28. int main()
  29. {
  30.     int min;
  31.     numbers numbers_;
  32.     printf("%d", numbers_ + numbers_);
  33.     return 0;
  34. }
Add Comment
Please, Sign In to add comment