Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void sort(int &a, int &b, int &c) {
- int min, centr, max;
- if (a >= b and b>=c) {
- max = a;
- centr = b;
- min = c;
- }
- //Добавить другие случаи
- a = min;
- b = centr;
- c = max;
- }
- int main()
- {
- int x, y, z;
- cin >> x >> y >> z;
- sort(x, y, z);
- cout << x << " " << y << " " << z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement