We also need the number of occurrences of each word.
The words must be in dictionary order.
The text will be supplied on standard input.
For example:
% a.out <text
381 a
1 abandoned
1 ability
10 able
19 about
2 above
1 abreast
1 absence
1 absent
3 absolutely
1 abyss
1 acceptance
2 accord
1 accumulation
....