#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n;
vector<int> v1;
cin >> n;
while (n--) {
int i;
cin >> i;
v1.push_back(i);
}
sort(v1.begin(), v1.end());
for (int i = 0; i < v1.size(); i++) {
cout << v1[i] << "\n";
}
}
정렬은 SORT를 이용해서 정렬을 해준후 출력해주면 된다.
'Algorithm' 카테고리의 다른 글
[백준] 알고리즘 11651번 - 좌표 정렬하기2 문제 (0) | 2020.12.30 |
---|---|
[백준] 알고리즘 11650번 - 좌표 정렬하기 문제 (0) | 2020.12.30 |
[백준] 알고리즘 1676번 - 팩토리얼 0의 개수 (0) | 2020.12.29 |
[백준] 알고리즘 10872번 - 팩토리얼 문제 (0) | 2020.12.29 |
[백준] 알고리즘 11653번 - 소인수분해 문제 (0) | 2020.12.29 |