매일 BOJ

(매일 BOJ) C++ 1427번 소트인사이드

norepinephrine 2025. 7. 24. 10:35

이번 문제는 1427번 소트인사이드 이다.

작성코드

# include <bits/stdc++.h>
using namespace std;

int main (void){
    ios::sync_with_stdio(0); cin.tie(0);
    int num;
    cin >> num;
    string s = to_string(num);
    sort(s.begin(),s.end(), [](int a, int b) {
        return a > b;
    });
    cout << s;
}