4.3BSD-UWisc/lib/learn/C/L5.1d

#print
Write a program that counts the blanks, tabs, and newlines
in its input, and prints the total.  Don't forget to
define the value of EOF at the beginning of your program.
The best way is to add

 #include <stdio.h>

as the first line of your program.
The ____must be in column 1.
(See page 143 of the C book.)
You may also have to say

cc name.c -lS

to compile the program.
#once #create Ref
This is some junk that
contains
	blanks
	tabs
	and newlines.
#user
a.out <Ref >test1
a.out </dev/null >test2
grep 13 test1 >/dev/null || grep 0 test2 >/dev/null
#succeed
One possible solution:

 #include <stdio.h>

main()
{
	int n, c;

	n = 0;
	while ((c = getchar()) != EOF)
		if (c == ' ' || c == '\t' || c == '\n')
			n++;
	printf("%d\n", n);
}

This program won't work on huge files, because an int
isn't big enough.
#log
#next
5.1e 10
5.2e 5