PROGRAMMING:Single digit Statistics (15)
Given a k-bit integer n = DK-1 * 10k-1 +... + D1 * 101 + d0 (0 < = Di < = 9, I = 0,..., k-1, DK-1 > 0), please write a program to count the times of each different digit. For example, given n = 100311, there are two zeros, three ones, and one three.
Input format:
Each input contains one test case, that is, a positive integer n with no more than 1000 bits.
Output format:
For each different digit in N, output the digit D and its times m in a row in the format of D: M. It is required to output in ascending order of D.
Input example:
one hundred thousand three hundred and eleven
Output example:
0:2
1:3
3:1
answer:If there is no answer, please comment
Input format:
Each input contains one test case, that is, a positive integer n with no more than 1000 bits.
Output format:
For each different digit in N, output the digit D and its times m in a row in the format of D: M. It is required to output in ascending order of D.
Input example:
one hundred thousand three hundred and eleven
Output example:
0:2
1:3
3:1
answer:If there is no answer, please comment