👤

Se dau trei numere A,B,C nu neaparat distincte...sa se afiseze in ordine crescatoare. C++ pls

Răspuns :

Răspuns:

#include <iostream>

using namespace std;

int main() {

int A, B, C, aux;

cin >> A >> B >> C;

if (A > B ){

aux = A;

A = B;

B = aux;

}

if (A > C) {

aux = A;

A = C;

C = aux;

}

if (B > C) {

aux = B;

B = C;

C = aux;

}

cout << A << " " << B << " " << C;

return 0;

}