DWITE '02 R2 #5 - Now I know my ABCs

View as PDF

Submit solution

Points: 5
Time limit: 0.6s
Memory limit: 32M

Problem type
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 255 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

There are no comments at the moment.