Question: The program must read standard input, collect a list of unique words, and print them in alphabetical order with counts of occurences of each word.

The program must read standard input, collect a list of unique words, and print them in alphabetical order with counts of occurences of each word. A word is a sequence of letters, lowercase or uppercase (including mixed), and it must be translated into lowercase letters only before including in the list of words.

Input

The standard input includes an arbitrary text. You can assume that there are no more than 10,000 unique words and the total length of all unique words is not more than 100,000 characters. You can also assume that no word is longer than 80 characters.

Output

Your program must print words in an alphabetical order, one word per line. After each word, there should be a space and the number of occurences of the word.

Sample input and output are given below:

The program must read standard input, collect a list of unique words,

Sample Input This is an example Sample Output an 7 example 2 is 3 More words: an is AN ExamplE-is An7aN an AN more 1 this 1 words 1 Sample Output, with visualized whitespace an 7 example 2 more 1Ln this 1n words 1m Note:- is a space, and Ln 1S a newline character. Sample Input This is an example Sample Output an 7 example 2 is 3 More words: an is AN ExamplE-is An7aN an AN more 1 this 1 words 1 Sample Output, with visualized whitespace an 7 example 2 more 1Ln this 1n words 1m Note:- is a space, and Ln 1S a newline character

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!