//编写一个将输入复制到输出的程序,并将其中连续的多个空格用一个空格代替
#include "stdafx.h"
#define NONBLANK 'a'
int _tmain ( int argc , _TCHAR * argv [])
{
int lastc , c ;
lastc = NONBLANK ;
while (( c = getchar ()) != EOF )
{
if ( c != ' ' || lastc != ' ' )
{
putchar ( c );
}
lastc = c ;
}
return 0 ;
}
#include "stdafx.h"
#define NONBLANK 'a'
int _tmain ( int argc , _TCHAR * argv [])
{
int lastc , c ;
lastc = NONBLANK ;
while (( c = getchar ()) != EOF )
{
if ( c != ' ' || lastc != ' ' )
{
putchar ( c );
}
lastc = c ;
}
return 0 ;
}