UVa 10815 - Andy's First Dictionary

Summary
Keep track of how many words are there in the input, defining a word as a contiguous sequence of alphabets, case-insensitive.

Explanation
There are many ways to do this - with a trie, a binary tree, a set, a hash table, a skiplist, among others.

Gotchas

 * If you simply read the input word-by-word (like using scanf("%s",word) and cin etc.), the 'word' you get might actually contain multiple words. See the input/output below for the idea.
 * A better alternative would be to handle the input line-by-line and use a "string tokenizer" (like strtok in C and Class StringTokenizer in java). You might need to think carefully about the (list of) delimiters though.

Implementations

 * Code All the Problems

Input
this"is"a"really"long"word good100cats good22dogs

Output
a cats dogs good is long really this word