1345 数字统计


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

对于每个给定的数串,例如:01234512345123,它都是由数字字符组成。请统计每个数字出现的次数。

Input

若干个数串,数串中最多也只包含0~9这些数字,数串长度<1000。

Output

每个数串输出一组统计数据,统计数据有最多不超过10行的数对,格式如A B,A为数串中出现的数字,按从小到大排列,B为数串中A数字出现的次数,A、B之间有一个空格。每组数据之间空一行。

Sample

Input

010101
123535120000000

Output

0 3
1 3

0 7
1 2
2 2
3 2
5 2

Source: 浙工大2008C++期中竞赛


Comments

There are no comments at the moment.