#include #define NORMAL 0 #define SPACEBARING 1 // trimming excessive spacebars down to one main() { int c; int state = NORMAL; while ((c = getchar()) != EOF) { if (state == NORMAL) { putchar(c); if (c == ' ') state = SPACEBARING; } if (state == SPACEBARING) { if (c != ' ') { state = NORMAL; putchar(c); } } } }