#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 11. We call a year that satisfies these conditions a special year.

Given 55 years, please calculate how many of them are special years.

Input Format

Input consists of 55 lines. Each line contains a 44-digit decimal number (ranging from 10001000 to 99999999), representing a year.

Output Format

Output an integer, representing how many of the 55 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