#C13553. Frequency Description
Frequency Description
Frequency Description
You are given a list of integers. Your task is to calculate the frequency of each unique integer and output the result as strings in the format number: count. The output should be sorted by the integer values in ascending order.
For example, if the input list is: 4 -1 -1 2 4 0 4
, then the expected output is:
-1: 2 0: 1 2: 1 4: 3
Please note that the input is provided as a single line from standard input and the result is printed to standard output, with one entry per line.
inputFormat
The input consists of a single line containing a space-separated list of integers. It is guaranteed that the input line is non-empty.
outputFormat
The output should contain several lines. Each line contains a frequency description in the format number: count, where number
is one of the integers from the input and count
is the number of times it appears. The lines must be sorted by the integer values in ascending order.
If no integers are provided, there should be no output.
## sample4 -1 -1 2 4 0 4
-1: 2
0: 1
2: 1
4: 3
</p>