[백준] 1427 소트인사이드

0

백준

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

[백준] 1427 소트인사이드

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

bool cmp(int a, int b) {
	return a > b;
}

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

	string str;
	cin >> str;
	
	vector<int> vec;
	for (int i = 0; i < str.length(); ++i) {
		vec.push_back(str[i] - '0');
	}

	sort(vec.begin(), vec.end(), cmp);

	for (int i = 0; i < vec.size(); ++i) {
		cout << vec[i];
	}
	return 0;
}

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

0개의 댓글