본문 바로가기
C++

[프로그래머스] 문자열 정렬하기 (2)

by 띰쥬 2025. 9. 6.
728x90
반응형
SMALL

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

string solution(string my_string) {
    string answer = "";
    for(auto str : my_string){
        if(isupper(str))
            answer+=tolower(str);
        else answer+=str;
    }
    
    sort(answer.begin(),answer.end());
    
    return answer;
}

728x90
반응형
LIST

댓글