Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.
Another simple one
Count amount of blanks in a sequence, then reset. If sequence is below 1, print current character
#include <stdio.h>
int main(){
int c;
int spaceCount = 0;
while((c = getchar()) != EOF){
if (c == ' ')
++spaceCount;
else
spaceCount = 0;
if (spaceCount <= 1)
putchar(c);
}
return 0;
}