-->
当前位置:首页 > 题库

PROGRAMMING:Counts the number of occurrences of each character in the string

Luz5年前 (2021-05-10)题库424
This topic requires reading in a string, statistics of the number of times each character appears in the string, the output results sorted in descending order.
###Input format:
Enter a string of arbitrary characters.
###Output format:
Output the number of times each character appears, and the output results are sorted in descending order.
###Input example:
Here is a set of inputs. For example:
```in
This is a good idea.
```
###Output example:
The corresponding output is given here. For example:
```out
: 4
i : 3
s : 2
a : 2
o : 2
d : 2
T : 1
h : 1
g : 1
e : 1
. : 1
```







answer:If there is no answer, please comment