Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, m, x, y, px, py;
  7. cin >> n >> m >> x >> y;
  8. if (m > n) {
  9. n = m + n;
  10. m = n - m;
  11. n = n - m;
  12. }
  13. px = m - x;
  14. py = n - y;
  15. if (x < y && x < px && x < py) {
  16. cout << x;
  17. }
  18. else if (y < x && y < px && y < py) {
  19. cout << y;
  20. }
  21. else if (px < x && px < y && px < py) {
  22. cout << px;
  23. }
  24. else {
  25. cout << py;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement