문제풀이:
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string my_string) {
string answer = "";
for(char c : my_string)
{
if(c>='A'&& c<='Z')
{
answer+=tolower(c);
}
else if(c>='a'&& c<='z')
{
answer+=toupper(c);
}
else
answer+=c;
}
return answer;
}
'코딩테스트' 카테고리의 다른 글
프로그래머스_1단계_약수의 합 C++ (0) | 2024.04.23 |
---|---|
프로그래머스_0단계_첫 번째로 나오는 음수 C++ (0) | 2024.04.23 |
프로그래머스_0단계_뒤에서 5등 위로 C++ (0) | 2024.04.23 |
프로그래머스_0단계_소문자로 바꾸기 C++ (0) | 2024.04.23 |
프로그래머스_0단계_홀수 vs 짝수 C++ (0) | 2024.04.23 |