int main(int argc, char* argv[])
{
int c,temp;
c = 'a';//初始化为一个不是空格的字符
while((c = getchar()) != EOF)
{
if(c == ' ' && c != temp)
putchar(c);
else if(c != ' ')
putchar(c);
temp = c; //保留上次输入的字符数值
}
return 0;
}
int main(int argc, char* argv[])
{
int c,temp;
c = 'a';//初始化为一个不是空格的字符
while((c = getchar()) != EOF)
{
if(c == ' ' && c != temp)
putchar(c);
else if(c != ' ')
putchar(c);
temp = c; //保留上次输入的字符数值
}
return 0;
}