Write a Java program that reads from standard input, printing the number of lines, words and alpha-numeric characters
that have been encountered when the end of input is reached. A word is defined to be a continuous sequence of alpha-numeric characters, so that
Dog
, 1955
and a2ps
are each words, while type-based
is two words.
For example, given the following input:
People love me at parties
when they ask me "Oh, you are a computer guy?
Can you fix my laptop?"
And I respond...
"Computer Science is no more about computers
than astronomy is about telescopes"
your program should print:
Lines: 6
Words: 35
Characters: 149
Reading from standard input can be performed as in question 2d33.