알고리즘104 프로그래머스 - 문자열 다루기 기본 (C++) 12345678910111213141516#include using namespace std; bool solution(string s) { if(!(s.length() == 4 || s.length() == 6)) return false; for(int i = 0; i 2020. 3. 5. 프로그래머스 - 문자열 내림차순으로 배치하기 (C++) 123456789101112131415#include #include using namespace std; bool compare(char a, char b){ return a > b;} string solution(string s) { sort(s.begin(), s.end(), compare); return s;}Colored by Color Scriptercs 2020. 3. 5. 프로그래머스 - 문자열 내 p와 y의 개수 (C++) 123456789101112131415161718192021222324252627282930313233#include #include using namespace std; bool solution(string s){ bool answer = true; int count_p = 0, count_y = 0; for(int i = 0; i 2020. 3. 5. 프로그래머스 - 문자열 내 마음대로 정렬하기 (C++) 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include #include #include #include using namespace std; int N; bool compare(string a, string b){ if(a[N] != b[N]) return a[N] 2020. 3. 5. 이전 1 ··· 22 23 24 25 26 다음