// глобальные константы (значения заданы для примера)
const int n = 10;
const int width = 2;
const int range = 10;
void RadixEnumSort(int x[]) {
int source[n] = {0};
for (int step = 0, rangepow = 1; step < width; step++, rangepow *= range) {
int count[range] = {0};
memcpy(source, x, sizeof(source));
for (int i = 0; i < n; i++) {
int d = (source[i] / rangepow) % range;
count[ d ]++;
}
int summNum = 0;
for (int i = 0; i < range; i++) {
int tmp = count[i];
count[i] = summNum;
summNum += tmp;
}
for (int i = 0; i < n; i++) {
int d = (source[i] / rangepow) % range;
x[ count[d] ] = source[i];
count[d]++;
}
}
}