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

PROGRAMMING:Palindrome date

Luz5年前 (2021-05-10)题库458
During the Spring Festival in 2020, there is a special date that has attracted everyone's attention: February 2, 2020. Because if the date is written in the format of "yyyymmdd" as an 8-digit number, it is 20200202, which is exactly a palindrome number. We call such date palindrome date.
*** Xiao Ming doesn't agree with this, because less than two years later is the next reply date: 20211202, that is, December 2, 2021.
Others say that 20200202 is not only a palindrome date, but also an abbaba palindrome date. Xiaoming does not agree with this, because about 100 years later, he will meet the next abbaba palindrome date: 21211212, that is, December 12, 2121. It's not "once in a thousand years", but "twice in a thousand years".
Given an 8-digit date, please calculate the next palindrome date and the next abbaba palindrome date after that date.
####Input format
The input contains an eight digit integer n for the date.
####Output format
Output two lines, one eight digit for each line. The first line represents the next palindrome date, and the second line represents the next abbaba palindrome date.
####Sample input
```in
twenty million two hundred thousand two hundred and two
```
####Sample output
```out
twenty million two hundred and eleven thousand two hundred and two
twenty-one million two hundred and eleven thousand two hundred and twelve
```
####Sample input
```in
eighty-nine million nine hundred and ninety-one thousand two hundred and thirty-one
```
####Sample output
```out
ninety million eleven thousand and nine
ninety million nine hundred thousand nine hundred and nine
```
####Scale and convention of evaluation case
For all evaluation cases, 10000101 ≤ n ≤ 89991231, ensure that n is an 8-digit representation of a legal date.
####Tips
This topic is selected from the Blue Bridge Cup competition, adding a set of test samples.








answer:If there is no answer, please comment