Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // AndeyLess
- //
- // Created by Kadir Kadyrov on 08.07.2020.
- // Copyright © 2020 Kadir Kadyrov. All rights reserved.
- //
- #include <iostream>
- #include <vector>
- #include <queue>
- #include <algorithm>
- using namespace std;
- //int main() {
- // int a[4];
- // cin >> a[0] >> a[1] >> a[2] >> a[3];
- //
- // sort(a, a + 4);
- //
- // cout << a[3] - a[0] << ' ' << a[3] - a[1] << ' ' << a[3] - a[2] << endl;
- //}
- int main () {
- int x1, x2, x3, x4;
- cin >> x1 >> x2 >> x3 >> x4;
- int maxx = max(x1, max(x2, max(x3, x4)));
- if(maxx != x1) {
- cout << maxx - x1 << ' ';
- }
- if(maxx != x2) {
- cout << maxx - x2 << ' ';
- }
- if(maxx != x3) {
- cout << maxx - x3 << ' ';
- }
- if(maxx != x4) {
- cout << maxx - x4 << ' ';
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement