-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboj2751.cpp
More file actions
51 lines (43 loc) · 881 Bytes
/
boj2751.cpp
File metadata and controls
51 lines (43 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//boj2751
//문자열 오름차순
/*
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int num, tmp;
vector<int> a;
cin >> num;
for (int i = 0; i < num; i++)
{
cin >> tmp;
a.push_back(tmp);
}
sort(a.begin(), a.end());
for (int i = 0; i < num; i++)
cout << a[i] << '\n';
}
*/
//boj10989
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int T;
cin >> T;
int arr[10001] = { 0 };
// 숫자 개수 카운트
for (int i = 0; i < T; i++) {
int a;
cin >> a;
arr[a] += 1;
}
// 각 숫자를 개수만큼 출력해주기
for (int i = 1; i <= 10000; i++)
for (int j = 0; j < arr[i]; j++)
cout << i << "\n";
}