프로그래머스 12930 이상한 문자 만들기

1 개요[ | ]

프로그래머스 12930 이상한 문자 만들기

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

string solution(string s) {
    int idx = 0;
    for(char& c: s) {
        if(c == ' ') {
            idx = 0;
            continue;
        }
        idx++;
        if(idx%2 == 0) {
            c = tolower(c);
        } else {
            c = toupper(c);
        }
    }
    return s;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}