DWITE Online Computer Programming Contest, November 2002, Problem 5
You are to determine the frequency of each letter of the alphabet in a line of characters.
Input Specification
The input will contain five lines of data. Each line will contain at most characters.
Output Specification
The output will contain five lines of data, each displaying the frequency of the letters of the alphabet, in alphabetical order, from the corresponding lines of the input file. Display only those letters that occurred at least once. Separate the letter from the frequency with a hyphen and follow the frequency with a colon (except the last one).
Sample Input (2 lines only)
This sentence has 4 t's in it.
And this one only has one.
Sample Output
A-1:C-1:E-3:H-2:I-3:N-3:S-4:T-4
A-2:D-1:E-2:H-2:I-1:L-1:N-4:O-3:S-2:T-1:Y-1
Comments