#P8752. [蓝桥杯 2021 省 B2] 特殊年份
[蓝桥杯 2021 省 B2] 特殊年份
Problem Description
This year is 2021. The number 2021 is very special: its thousands digit equals its tens digit, and its ones digit is greater than its hundreds digit by . We call a year that satisfies these conditions a special year.
Given years, please calculate how many of them are special years.
Input Format
Input consists of lines. Each line contains a -digit decimal number (ranging from to ), representing a year.
Output Format
Output an integer, representing how many of the input years are special years.
2019
2021
1920
2120
9899
2
Hint
Sample Explanation.
2021 and 9899 are special years. The others are not special years.
Lanqiao Cup 2021, second round provincial contest, Group B, Problem F.
Translated by ChatGPT 5