[백준] 10989 수 정렬하기 3

0

백준

목록 보기
157/271
post-thumbnail
post-custom-banner

[백준] 10989 수 정렬하기 3

#include <iostream>
#include <algorithm>
using namespace std;

int numcnt[10001] = { 0 };

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n;
	cin >> n;

	for (int i = 0; i < n; ++i) {
		int num;
		cin >> num;
		numcnt[num]++;
	}

	for (int num = 1; num < 10001; ++num) {
		for(int j = 0; j < numcnt[num]; ++j)
			cout << num << "\n";
	}
	return 0;
}

profile
Be able to be vulnerable, in search of truth
post-custom-banner

0개의 댓글