/********************************************************************** * Copyright (c) Digital Equipment Corporation 1984, 1985, 1986. * * All Rights Reserved. * * Reference "/usr/src/COPYRIGHT" for applicable restrictions. * **********************************************************************/ static char Sccsid[] = "@(#)lcount.c 3.0 4/21/86"; #include "stdio.h" main() /* count lines in something */ { register n, c; n = 0; while ((c = getchar()) != EOF) if (c == '\n') n++; printf("%d\n", n); }