Skip to content

Instantly share code, notes, and snippets.

@Adals20
Created February 17, 2017 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adals20/5958a95e2d3eb1967b3677506e1048e2 to your computer and use it in GitHub Desktop.
Save Adals20/5958a95e2d3eb1967b3677506e1048e2 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
main(){
int x1,x2,x3;
cout << "\tIntroduce tres numeros para acomodarlos de menor a mayor\n";
cout << "Numero 1: "; cin >> x1;
cout << "Numero 2: "; cin >> x2;
cout << "Numero 3: "; cin >> x3;
cout << endl;
if (x1 <= x2 && x1 <= x3)
if (x2 <= x3){
cout << x1 << endl;
cout << x2 << endl;
cout << x3 << endl;
}else{
cout << x1 << endl;
cout << x3 << endl;
cout << x2 << endl;
}
if (x2 <= x1 && x2 <= x3)
if (x1 <= x3){
cout << x2 << endl;
cout << x1 << endl;
cout << x3 << endl;
}else{
cout << x2 << endl;
cout << x3 << endl;
cout << x1 << endl;
}
if (x3 <= x1 && x3 <= x1)
if (x1 <= x2){
cout << x3 << endl;
cout << x1 << endl;
cout << x2 << endl;
}else{
cout << x3 << endl;
cout << x2 << endl;
cout << x1 << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment