Advertisement
STANAANDREY

eMINMAX

Dec 11th, 2019
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. float mini(float x, float y)
  5. {
  6.     if (x > y)
  7.         return y;
  8.     return x;
  9. }
  10.  
  11. float maxi(float x, float y)
  12. {
  13.     if (x < y)
  14.         return y;
  15.     return x;
  16. }
  17.  
  18. float E(float x, float y)
  19. {
  20.     if (x * x + y * y >= 1)
  21.         return mini(x, y);
  22.     return maxi(x, y);
  23. }
  24.  
  25. int main()
  26. {
  27.     int x, y;
  28.     cin >> x >> y;
  29.     cout << E(x, y);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement