class Solution {
public:
void replaceSpace(char *str,int length) {
string str_2 = "";
int plus_length = 0;
for(int i = 0;i<length;i++){
if(str[i] != ' '){
str_2 += str[i];
}
else {
str_2 += "%20";
plus_length += 2;
}
}
length += plus_length;
for(int j = 0;j<length;j++){
str[j] = str_2[j];
}
}
}; 
京公网安备 11010502036488号