problem
solution1:
class Solution {
public:
string toLowerCase(string str) {
string res = "";
for(auto ch:str)
{
if(ch>='A'&&ch<='Z') ch +=;
res += ch;
}
return res;
}
};
solution2:
class Solution {
public:
string toLowerCase(string str) {
for(auto &ch:str)
{
if(ch>='A'&&ch<='Z') ch +=;
}
return str;
}
};
参考
1. Leetcode_easy_709. To Lower Case;
2. Grandyang;
完