1 #ifndef lint 2 static char sccsid[] = "@(#)lcount.c 4.2 (Berkeley) 04/25/83"; 3 #endif not lint 4 5 #include "stdio.h" 6 7 main() /* count lines in something */ 8 { 9 register n, c; 10 11 n = 0; 12 while ((c = getchar()) != EOF) 13 if (c == '\n') 14 n++; 15 printf("%d\n", n); 16 } 17