/* The C Programming Language,
solution to Exercise 1-9 */
#include <stdio.h>
/* A small application which copys our input to our output
but reduces all series of blanks in our input to only
one blank per series in our output. */
main()
{
int c;
int noMoreBlanks = 0;
while ((c = getchar()) != EOF ){
if (c == ' '){
if (noMoreBlanks)
continue;
else{
putchar(c);
noMoreBlanks = 1;
}
}
else{
if (noMoreBlanks)
noMoreBlanks = 0;
putchar(c);
}
}
}