class Solution {
public:
void replaceSpace(char *str,int length) {
int i=0;
while(str[i]!='\0'){
if(str[i]==' '){
for(int j=length-1;j>i;j--){
str[j+2]=str[j];
}
str[i]='%';
str[i+1]='2';
str[i+2]='0';
i=i+2;
length=length+2;
}
else i++;
}
}
};
11-22
07-22
07-22
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交