Question: Word Count in C The C program must read standard input, collect a list of unique words, and print them in alphabetical order with counts
Word Count in C
The C 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. (NOTE: PROGRAM MUST WORK FOR THE TEST CASE)
Sample Input (NOTE: MUST READ AND TAKE INPUT UNTIL EOF SINCE IT'S ARBITRARY TEXT FROM STANDRD INPUT. THE BLANK LINE IS A NEW LINE NOT THE END OF INPUT) This is an example. More words: an is AN ExamplE-is An7aN an AN
Sample Output an 7 example 2 is 3 more 1 this 1 words 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
