输入10个数
最大的不超过100
#include<iostream>
using namespace std;
int main() {
int A[10]; int C[100] = { 0 }; int B[10] = { 0 };
for (int i = 0; i < 10; i++) {
cin >> A[i];
C[A[i]]++;
}
for (int i = 1; i < 100; i++) {
C[i] += C[i - 1];
}
for (int j = 9; j >=0; j--) {
B[--C[A[j]]] = A[j];
}
for (int i = 0; i <10; i++)
cout << B[i] << " ";
return 0;
}