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 }