#P1598. Histogram of Uppercase Characters
Histogram of Uppercase Characters
Histogram of Uppercase Characters
Write a program that reads four lines of uppercase letters (each line contains at most $100$ characters) from the input, and then outputs a histogram showing the frequency of each character. In the histogram, each line should display an uppercase letter followed by a colon and a string of asterisks (*) representing the number of times the letter appears.
You must strictly follow the output format as given in the sample output.
inputFormat
The input consists of four lines. Each line is a non-empty string consisting solely of uppercase letters, with a maximum length of $100$ characters.
outputFormat
For each uppercase letter that appears in the input, output a single line in the following format:
LETTER: <bar>
Here, LETTER
is an uppercase letter and <bar>
is a sequence of asterisks (*) whose count is equal to the number of occurrences of that letter. The letters must be printed in alphabetical order.
sample
ABCD
EFGH
IJKL
MNOP
A: *
B: *
C: *
D: *
E: *
F: *
G: *
H: *
I: *
J: *
K: *
L: *
M: *
N: *
O: *
P: *
</p>