#include <stdio.h>
#define MAX 10
void swap(int a[], int b[])
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
void sort(int list[],int n)
{
int i, j, tmp, least;
for (j = 0; j < n - 1; j++) {
least = j;
for (i = j + 1; i < n; i++) {
if (list[i] < list[least]) {
least = i;
}
}
swap(list[j], list[least]);
}
}
int main(void)
{
int i;
int list[MAX] = {23, 9, 37, 6, 88, 12, 56, 91, 7, 45};
sort(list,MAX);
for (i = 0; i < MAX; i++) {
printf("%d ", list[i]);
}
printf("n");
}