Problem-solving119 프로그래머스 - 서울에서 김서방 찾기 (C++) 12345678910111213#include #include #include using namespace std; string solution(vector seoul) { string answer = "김서방은 "; answer += to_string(distance(seoul.begin(), find(seoul.begin(), seoul.end(), "Kim"))); return answer + "에 있다";}Colored by Color Scriptercs 2020. 3. 5. 프로그래머스 - 문자열 다루기 기본 (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. 이전 1 ··· 22 23 24 25 26 27 28 ··· 30 다음