Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- //#include
- using namespace std;
- inline void intercambio(tipoElemento Aa[], int i, int j)
- { tipoElemento t = a[i]; a[i] = a[j]; a[j] = t;}
- ordenar3(tipoElemento a[], int N)
- {
- if (a[1] > a[2]) intercambio(a, 1, 2);
- if (a[1] > a[3]) intercambio(a, 1, 3);
- if (a[2] > a[3]) intercambio(a, 2, 3);
- }
- const int maxN = 100;
- int main()
- {
- int N, i;
- tipoElemento v, a[maxN+1];
- N = 0;
- while (cin >> v) a[++N] = v;
- a[0] = 0;
- ordenar3(a, N);
- for (i = 1; i<= N; i++) cout << a[i] << ' ' << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment