DWITE Online Computer Programming Contest, December 2008, Problem 2
There's an essay due in class, and your teacher demands at least a certain minimum length from your paper. Caring more about optimization than the subject of ancient history, a wordcount tool would come in handy; and save you from writing any more words than you need to.
Knowing that your teacher counts only the words that are more than three letters long (having a similar software tool of her own), your program would need to do just that – count the words that are at least letters long.
The input will contain lines, each a line of English text, no more than characters in length.
The output will contain integer values – count of words over letters long, in each line.
Sample Input
DWITE question number two: Wordcount++
Note how "two:" does not count.
For simplicity - "don't" is two words, split by apostrophe.
That was a blank line above.
Sample Output
4
3
4
0
4
Problem Resource: DWITE
Comments
For anyone having trouble with this problem, words with contractions (e.g., one's, don't, I'll, etc.) are not considered words and punctuation marks (at the start or end of a word) are not considered characters that contribute to a word's length.