Vertical Histogram
InterviewTime limit1sMemory limit1024 MB
Count how many times each capital letter appears in four input lines and print a vertical asterisk histogram with the alphabet below.
- Level
Easy2 of 10
- Topics
- Array, Implementation, String
- Solved
- No attempts yet
Problem
Write a program to read four lines of upper case (all capital letters) text from the input file and print a vertical histogram showing how many times each letter appears in the input. Blanks, digits, and punctuation are not counted. Format your output exactly as shown.
Input
Lines 1 to 4: Four lines of upper case text, no more than 72 characters per line.
Output
Several lines with asterisks and spaces, followed by one line with the upper-case alphabet separated by spaces. Do not print unneeded blanks at the end of any line. Do not print any leading blank lines.