4949. 字符串处理

Naive循环函数字符串普通指针

时间限制:2000 ms

内存限制:512 MiB

题面

编写一个函数,删除给定字符串s中所有的空格,其余字符按照原来顺序存放。

函数说明:
void del(char s[]);
//Precondition:s存放一个字符串;
//Postcondition:删除s中所有空格,其余字符按原来顺序存放在s中。

#include <stdio.h>
#include <string.h>
void del(char s[])
{
   // 函数实现
}
int main()
{
    char s[110000];
    gets(s);  //输入一行字符
    del(s);
    printf("%s\n",s);
    return 0;
}

样例

输入

   He  llo  wor   ld    

输出

Helloworld