아스키코드2 49★] 프로그래머스 시저 암호 공백이면 그냥 넘어간다 소문자는 소문자에서 돌고( z -> a) 대문자는 대문자에서 돈다,( Z -> A) #include using namespace std; string solution(string s, int n) { for(int i = 0;i='a' && s[i] 122) s[i] += (n-26); else s[i] +=n; } // 대문자 else if(s[i] >= 'A' && s[i] 90){ s[i] -= 26; } } } return s; } 소문자에서 조심 아스키코드는 127까지만 있다.. ? 2020. 9. 17. 13] Leetcode 709. To Lower Case To Lower Case - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 대문자를 소문자로 class Solution { public: string toLowerCase(string str) { for(int i=0;i='A' && str[i] 2020. 6. 25. 이전 1 다음