强行用c++写
替换空格
http://www.nowcoder.com/questionTerminal/4060ac7e3e404ad1a894ef3e17650423
class Solution {
public:
void replaceSpace(char *str,int length) {
string s(str);
string res;
for(auto &x:s){
if(x==' ')
res+="%20";
else
res+=x;
}
auto ret=res.c_str();
strcpy(str,ret);
}
};