프로그래머스 181949 대소문자 바꿔서 출력하기

1 개요[ | ]

프로그래머스 181949 대소문자 바꿔서 출력하기

2 C++[ | ]

#include <iostream>
#include <string>

using namespace std;

int main(void) {
    string str;
    cin >> str;
    for(int i=0; i<=str.length(); i++) {
        if(str[i] < 'a') str[i] = tolower(str[i]);
        else str[i] = toupper(str[i]);
    }
    cout << str;
    return 0;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}