程序的功能是:删除字符串s中的素有空白符(包括tab符、回车符),请填空。

#include<stdio.h>
#include<string.h>
#include<ctype.h>
delspace(char *t)
{ int m,n;
char c[80];
for(m=0,n=0;_________;m++)
if(!isspace(_________)) /*C语言提供的库函数,用以判断字符是否为空白符*/
{ c[n]=t[m]; n++; }
c[n]='\0';
strcpy(t,c);
}
void main()
{ char s[80];
gets(s);
delspace(s);
puts(s);
}

#include<stdio.h>

#include<string.h>

#include<ctype.h>

void delspace(char *t)

{ int m,n;

  char c[80];

  for(m=0,n=0;t[m];m++)

if(!isspace(t[m]))    /*C语言提供的库函数,用以判断字符是否为空白符*/

{ c[n]=t[m]; n++; }

c[n]='\0';

strcpy(t,c);

}

main()

{ char s[80];

  gets(s);

  delspace(s);

  puts(s);

}

温馨提示:答案为网友推荐,仅供参考
相似回答