class Solution {
public:
string replaceSpace(string s) {
string ans = "";
for(auto ch : s) {
if(ch == ' ') ans += "%20";
else ans += ch;
}
return ans;
}
};
【leetcode C++】【剑指 Offer】 05. 替换空格
猜你喜欢
转载自blog.csdn.net/m0_37454852/article/details/114385164
今日推荐
周排行