Digit Count
题号:NC226680
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Dr. Orooji’s children have played Tetris but are not willing to help Dr. O with a related problem.
Dr. O’s children don’t realize that Dr. O is lucky to have access to 100+ great problem solvers and
great programmers today!

Given a range (in the form of two integers) and a digit (0-9), you are to count how many
occurrences of the digit there are in the given range.

输入描述:

There is only one input line; it provides the range and the digit. Each integer for the range will be
between 1000 and 9999 (inclusive) and the digit will be between 0 and 9 (inclusive). Assume the
first integer for the range is not greater than the second integer for the range.

输出描述:

Print the number of occurrences of the digit in the given range.
示例1

输入

复制
1000 1000 0

输出

复制
3
示例2

输入

复制
1000 1001 0

输出

复制
5
示例3

输入

复制
8996 9004 5

输出

复制
0
示例4

输入

复制
9800 9900 5

输出

复制
20