1#include <iostream>
2#define MAX 100
3using namespace std;
4void main() {
5 int A[MAX], n, I, J, MIN, TEMP;
6 cin >> n;
7 for (I = 0; I < n; I++)
8 cin >> A[I];
9 for (I = 0; I < n - 1; I++) {
10 MIN = I;
11 for (J = I + 1; J < n; J++)
12 if (A[J] < A[MIN])
13 MIN = J;
14 if (I != MIN) {
15 TEMP = A[I];
16 A[I] = A[MIN];
17 A[MIN] = TEMP;
18 }
19 }
20 for (I = 0; I < n; I++)
21 cout << A[I] << " ";
22}