#C14055. Character Frequency Counter
Character Frequency Counter
Character Frequency Counter
Given a string, calculate the frequency of each distinct character. For each character in the string, count the number of times it appears and print the result in the format (\texttt{char: count}) on a new line, preserving the order in which each character appears for the first time. If the input string is empty, the program should output nothing. The solution should read from standard input (stdin) and output to standard output (stdout).
inputFormat
The input consists of a single line containing the string.
outputFormat
For each distinct character (in the order of their first appearance in the input), output a line in the format: "char: count". If the input is empty, output nothing.## sample
abracadabra
a: 5
b: 2
r: 2
c: 1
d: 1
</p>