[刷题] 字符串去空格

如题

1 #include<stdio.h>
2 int main() {
3     int i,j=0;
4     char a[]="How are you";
5     for(i=0; a[i]; i++)
6         if(a[i]!=' ') a[j++]=a[i];
7     a[j]='';
8     printf("%s
",a);
9 }
原文地址:https://www.cnblogs.com/cxc1357/p/10836634.html