solution.c (301B)
1 #include <stdio.h> 2 main() { 3 int c; 4 char last_white = 0; 5 while ((c = getchar()) != EOF) { 6 if (last_white) { 7 if (c != ' ') { 8 last_white = 0; 9 putchar(c); 10 } 11 } else if (c == ' ') { 12 putchar(c); 13 last_white = 1; 14 } else { 15 putchar(c); 16 } 17 } 18 }