将 字 符 串 中 的 空 格 替 换 成 “%020” , 例 如 “hello world how ”
->”hello%020%020%020world%020%020%020how%020%020%020%020
#include<stdio.h>
#include<stdlib.h>#include<string.h>
int main(){
char c [100];
int i,j;
int len;
while(fflush(stdin),gets(c)!=NULL){
len=strlen(c);
for(i=0;i<len;i++){
if(32==c[i]){
printf("%s","%020");
}else {
printf("%c",c[i]);
}
}
printf("\n");
}
system ("pause");
return 0;
}