#include "Matrix.h"
const int N = 105;
int a[N];
int main()
{
int n;
cin >> n;
int mx, mn;
cin >> a[0];
mn = mx = a[0];
for (int i = 1; i < n; i++)
{
cin >> a[i];
if (a[i] > mx) mx = a[i];
if (a[i] < mn) mn = a[i];
}
int mapp[N];
for (int i = 0; i < mx - mn + 1; i++)
mapp[i] = 0;
for (int i = 0; i < n; i++)
mapp[a[i] - mn]++;
for (int i = 0; i < mx - mn + 1; i++)
if (mapp[i] != 0)
{
cout << i + mn << ' ';
mapp[i]--;
i--;
}
cout << endl;
system("pause");
return 0;
}
/*
10
1 3 56 7 98 33 44 67 8 3
*/
箱子排序
最新推荐文章于 2021-11-17 03:59:35 发布