#include <iostream>
#include <cstdio>
using namespace std;
const int Maxm = 1000 + 2;
int n[Maxm];
int main()
{
int m;
scanf("%d", &m);
for(int i = 1; i <= m; i++)
scanf("%d", &n[i]);
for(int i = 1; i <= m; i++)
{
int key = i;
for(int r = i + 1; r <= m; r++)
if(n[r] < n[key]) key = r;
swap(n[i], n[key]);
}
for(int i = 1; i <= m; i++)
printf("%d ", n[i]);
printf("
");
return 0;
} //时间复杂度:O(n2)
冒泡排序的小范围优化(我实在不知道冒泡怎么写了,所以可能会有误解, 欢迎指正)