/*- * Copyright (c) 1983 The Regents of the University of California. * All rights reserved. * * %sccs.include.proprietary.c% */ #ifndef lint char copyright[] = "@(#) Copyright (c) 1983 The Regents of the University of California.\n\ All rights reserved.\n"; #endif /* not lint */ #ifndef lint static char sccsid[] = "@(#)lcount.c 4.3 (Berkeley) 04/17/91"; #endif /* not lint */ #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); }