Advertisement
kadeyrov

Untitled

Oct 4th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. //
  2. // main.cpp
  3. // AndeyLess
  4. //
  5. // Created by Kadir Kadyrov on 08.07.2020.
  6. // Copyright © 2020 Kadir Kadyrov. All rights reserved.
  7. //
  8.  
  9. #include <iostream>
  10. #include <vector>
  11. #include <queue>
  12. #include <algorithm>
  13.  
  14. using namespace std;
  15.  
  16. //int main() {
  17. // int a[4];
  18. // cin >> a[0] >> a[1] >> a[2] >> a[3];
  19. //
  20. // sort(a, a + 4);
  21. //
  22. // cout << a[3] - a[0] << ' ' << a[3] - a[1] << ' ' << a[3] - a[2] << endl;
  23. //}
  24.  
  25. int main () {
  26. int x1, x2, x3, x4;
  27. cin >> x1 >> x2 >> x3 >> x4;
  28.  
  29. int maxx = max(x1, max(x2, max(x3, x4)));
  30.  
  31. if(maxx != x1) {
  32. cout << maxx - x1 << ' ';
  33. }
  34. if(maxx != x2) {
  35. cout << maxx - x2 << ' ';
  36. }
  37. if(maxx != x3) {
  38. cout << maxx - x3 << ' ';
  39. }
  40. if(maxx != x4) {
  41. cout << maxx - x4 << ' ';
  42. }
  43. cout << endl;
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement