#include using namespace std; void order(int & x, int & y) // x, y are REFERENCE parameters { if (y < x) { const int orig_x = x; x = y; y = orig_x; } } int main() { int a, b, c; cin >> a; cin >> b; cin >> c; cout << "a = " << a << " "; cout << "b = " << b << " "; cout << "c = " << c << " "; cout << "\n"; order(a, b); order(b, c); // guarantees that C is the biggest of the three order(a, b); cout << "a = " << a << " "; cout << "b = " << b << " "; cout << "c = " << c << " "; cout << "\n"; }