-->
当前位置:首页 > 题库

PROGRAMMING:Counting problem

Luz5年前 (2021-05-10)题库366
How many times does the number x (0 ≤ x ≤ 9) appear in all integers from interval 1 to n? For example, in 1 to 11, that is, in 1,2,3,4,5,6,7,8,9,10,11, the number 1 appears four times.
###Input format:
Two integers n, X (1 ≤ n ≤ 1000, 0 ≤ x ≤ 9), separated by a space.
###Output format:
An integer representing the number of times x appears.
###Input example:
```in
11 1
```
###Output example:
```out
four
```







answer:If there is no answer, please comment