Problem E: 【36课】【3216】计数问题
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:103
Solved:46
Description
试计算在区间1到n的所有整数中,数字x(0≤x≤9) 共出现了多少次?例如,在1到11中,即在1,2,3,4,5,6,7,8,9,10,11中,数字1 出现了 4 次。
Input
2 个整数 n , x ,之间用一个空格隔开。对于 100% 的数据,1≤n≤1,000,000, 0≤x≤9。
Output
1个整数,表示 x 出现的次数。
Sample Input Copy
11 1
Sample Output Copy
4