반응형
대문자를 소문자로
class Solution {
public:
string toLowerCase(string str) {
for(int i=0;i<str.size();i++)
if(str[i]>='A' && str[i]<='Z')
str[i] +=32;
//cout<<'A'-'a';
return str;
}
};
아스키코드
반응형
'IT > 알고리즘' 카테고리의 다른 글
15] Leetcode 1464. Maximum Product of Two Elements in an Array (0) | 2020.06.25 |
---|---|
14] Leetcode 1221. Split a String in Balanced Strings (0) | 2020.06.25 |
12] Leetcode 1486. XOR Operation in an Array (0) | 2020.06.24 |
11] Leetcode 1295. Find Numbers with Even Number of Digits (0) | 2020.06.24 |
10] Leetcode 1389. Create Target Array in the Given Order (0) | 2020.06.23 |
댓글