曹文信息在线OJ
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
Login
Register
5485: 计数问题
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:27
Solved:25
Submit
Submit Record
Statistics
Web Board
ShowOff!
Description
试计算在区间
1
1
到
n
n
的所有整数中,数字
x(0 ≤ x ≤ 9)
共出现了多少次?例如,在 1到
11
中,数字1出现了4次。
Input
2
个整数
n
,
x
,之间用一个空格隔开。
Output
1
个整数,表示
x
出现的次数。
Sample Input
Copy
11 1
Sample Output
Copy
4
HINT
对于
1
0
0
%
的数据,
1≤ n ≤ 1,000,000,0 ≤ x ≤ 9
。
Source/Category
循环基础