#P1215. 【例36.2】 计数问题
【例36.2】 计数问题
Description
试计算在区间$1$到$n$的所有整数中,数字$x(0≤x≤9)$ 共出现了多少次?例如,在$1$到$11$中,即在$1$,$2$,$3$,$4$,$5$,$6$,$7$,$8$,$9$,$10$,$11$中,数字$1$ 出现了 $4$ 次。Input Format
$2$ 个整数 $n$ , $x$ ,之间用一个空格隔开。对于 $100$% 的数据,$1≤n≤1,000,000$, $0≤x≤9$。Output Format
$1$个整数,表示 $x$ 出现的次数。11 14
Source
http://bas.ssoier.cn:8086/problem_show.php?pid=3216 循环结构相关
在下列比赛中: