learning-cc4e

Solution to https://cc4e.com/. If you copy these you're not right in the head.
git clone https://kaka.farm/~git/learning-cc4e
Log | Files | Refs

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 }