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);
}
};
京公网安备 11010502036488号