#include <stdio.h>
void countSort(int arr[], int len, int orderArr[]){
int count [len];
for(int i = 0; i < len; ++i){
count[i] = 0;
}
for(int i = 0; i < len; ++i){
for(int j = i + 1; j < len; ++j){
if(arr[i] < arr[j]){
count[j] = count[j] + 1;
}else{
count[i] = count[i] + 1;
}
}
}
for(int i = 0; i < len; ++i){
orderArr[count[i]] = arr[i];
}
}
int main () {
int arr[6] = {28,34,18,54,137,85};
int orderArr[6];
countSort(arr,6,orderArr);
for(int i = 0; i < 6; ++i){
printf("%d ",orderArr[i]);
}
return 0;
}