ZOJ Problem Set - 2392
Given two integers a and b, we write the numbers between a and b, inclusive, in a list. Your task is to calculate the number of occurrences of each digit. For example, if a = 1024 and b = 1032, the list will be
there are ten 0s in the list, ten 1s, seven 2s, three 3s, and etc.
The input consists of up to 500 lines. Each line contains two numbers a and b where 0 < a, b < 100000000. The input is terminated by a line "0 0", which is not considered as part of the input.
For each pair of input, output a line containing ten numbers separated by single spaces. The first number is the number of occurrences of the digit 0, the second is the number of occurrences of the digit 1, etc.
1 2 1 1 1 1 1 1 1 1
Source: Asia 2004, Shanghai (Mainland China)