1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <string> #include <algorithm> using namespace std; bool compare(char a, char b){ return a > b; } string solution(string s) { sort(s.begin(), s.end(), compare); return s; } | cs |
'Problem-solving > 프로그래머스' 카테고리의 다른 글
프로그래머스 - 서울에서 김서방 찾기 (C++) (0) | 2020.03.05 |
---|---|
프로그래머스 - 문자열 다루기 기본 (C++) (0) | 2020.03.05 |
프로그래머스 - 문자열 내 p와 y의 개수 (C++) (0) | 2020.03.05 |
프로그래머스 - 문자열 내 마음대로 정렬하기 (C++) (0) | 2020.03.05 |
프로그래머스 - 두 정수 사이의 합 (C++) (0) | 2020.03.04 |
댓글