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 (249B)


      1 #include <stdio.h>
      2 main() /* count new lines in input */
      3 {
      4     int c, nl, nblanks;
      5     nblanks = nl = 0;
      6     while ((c = getchar()) != EOF) {
      7         if (c == '\n')
      8             ++nl;
      9   if (c == ' ') ++nblanks;
     10 }
     11     printf("%d %d\n", nblanks, nl);
     12 }