将其中连续的多个空格用一个空格代 替。 这个程序没看懂,求帮忙解释下
#include <stdio.h>main()
{
int c,lastc;
while((c = getchar()) != EOF){
if (c != ' ')
putchar(c);
if (c == ' ')
if (lastc != ' ')
putchar(c);
lastc = c;
}
}
2016-12-16 14:47
2016-12-18 22:03
2016-12-18 22:04