10815 - Andy's First Dictionary
Keep track of how many words are there in the input, defining a word as a contiguous sequence of alphabets, case-insensitive.
- 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.
this"is"a"really"long"word good100cats good22dogs
a cats dogs good is long really this word