728x90
반응형
SMALL
#include <string>
#include <vector>
#include <cctype>
using namespace std;
string solution(string my_string) {
string answer = "";
//대->소, 소->대
//대:65~90, 소:97~102
for(char str : my_string){
if(isupper(str))
answer += str+32;
else
answer += str-32;
}
return answer;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
[프로그래머스] 약수 구하기 (0) | 2025.09.06 |
---|---|
[프로그래머스] 인덱스 바꾸기 (0) | 2025.09.05 |
[프로그래머스] 암호 해독 (0) | 2025.09.05 |
[프로그래머스] 최댓값 만들기 (2) (0) | 2025.09.05 |
[프로그래머스] 숨어있는 숫자의 덧셈 (1) (0) | 2025.09.05 |
댓글