-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3numeros_internet.cpp
More file actions
42 lines (41 loc) · 1.17 KB
/
Copy path3numeros_internet.cpp
File metadata and controls
42 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<iostream>
using namespace std;
int main()
{
int a,b,c,x,y,o,p,q; /* declaracion variables */
// clrscr(); /*************************/
cout<<"\na : "; /* */
cin>>a; /* */
cout<<"\nb : "; /* Ingreso de valores */
cin>>b; /* */
cout<<"\nc : "; /* */
cin>>c; /*************************/
// getch();
o=a; p=b;q=c; /* "Backup" de valores ingresados para impresion final */
if(c<b)
{
x=c;
y=b; /* comparacion entre el 3er y 2do valor */
b=x;
c=y;
}
if(b<a)
{
x=b;
y=a; /* comparacion entre el 2do y 1er valor */
a=x;
b=y;
}
if(c<b)
{
x=c;
y=b; /* comparacion entre el 3er y 2do valor */
b=x;
c=y;
}
// getch();
cout<<"Los numeros son: "<<o<<" "<<p<<" "<<q<<"\n"; /* Impresion valores originales */
cout<<"Y ordenados son: "<<a<<" "<<b<<" "<<c<<"\n"; /* Impresion valores ordenados */
// getch();
return (0);
}