char* replaceSpace(char* s){
char* S=(char*)calloc(strlen(s)*3+1,sizeof(char));
int i=0,k=0;
while(s[i]!='\0')
{
if(s[i]==' ')
{
S[k++]='%';
S[k++]='2';
S[k++]='0';
}
else
S[k++]=s[i];
i++;
}
return S;
}
LeetCode打卡22
最新推荐文章于 2023-03-17 16:54:02 发布