#for0011. 统计

统计

Problem Description

$ 试计算在区间1到n的所有整数中,数字x(0 \le x \le 9)共出现了多少次?例如,在1到11中,即在1,2,3,4,5,6,7,8,9,10,11中,数字1出现了4次。 $

Input Format

$ 2个整数n,x,之间用一个空格隔开。 $

Output Format

$ 1个整数,表示x出现的次数。 $

11 1
4

Hint

对于 100% 的数据,$ 1 \le n \le 1,000,000 ;  0 \le x \le 9。 $

Source

GLLXX https://vip.gllxx.com