Little Jay

[C++] 백준 2751번 수 정렬하기 2 본문

알고리즘/BOJ

[C++] 백준 2751번 수 정렬하기 2

Jay, Lee 2021. 3. 11. 13:59
#include <iostream>
#include <algorithm>
#include <vector>
using  namespace std;

int main() {
	ios::sync_with_stdio(false);

	int testCase, a;
	cin >> testCase;

	vector<int> list;

	for (int i = 0; i < testCase; i++) {
		cin >> a;
		list.push_back(a);
	}

	sort(list.begin(), list.end());

	for (int i = 0; i < testCase; i++) {
		cout << list[i] << "\n";
	}

	return 0;
}

'알고리즘 > BOJ' 카테고리의 다른 글

[C++] 백준 10250번 ACM호텔  (0) 2021.03.11
[C++] 백준 1085번 직사각형에서 탈출  (0) 2021.03.11
[C++] 백준 1259번 팰린드롬수  (0) 2021.03.08
[C++] 백준 10951번 A+B - 4  (0) 2021.03.08
[C++] 백준 10818번 최소, 최대  (0) 2021.03.08
Comments