05. 替换空格
遍历判断即可。
class Solution { public: string replaceSpace(string s) { std::ios::sync_with_stdio(false); string tmp; for(auto a : s){ if(a == ' ') tmp += "%20"; else tmp += a; } return tmp; } };