#include <stdio.h>

int main() {
    int n,num;
    //n개의 숫자 입력
    scanf("%d",&n);
    //정렬, 숫자크기순으로 몇개 나왔는지 저장 범위가 1~10001
    int sort_num[10001]={0};
    //숫자 입력 받고 그 숫자 위치에 +1
    for (int i=0; i<n; i++) {
        scanf("%d",&num);
        sort_num[num-1]++;
    }
    //숫자 범위 안에 0아닌거 j번 출력
    for(int i=0; i<10001; i++) {
        if(sort_num[i]!=0) {
            for(int j=0; j<sort_num[i]; j++) {
                printf("%d\n",i+1);
            }
        }
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: