acm The Least Palindromic Number
题目
acm The Least Palindromic Number
Description
Palindromic numbers are digital strings that read the same both forwards and backwards. For example, 121, 44 and 3 are Palindromic numbers, 175, 36 are not;
For a given integer N, you are to find a palindromic number P that satisfy P>N. However, there are many such palindromic numbers. Your task is to find the least one.
Input
There are several test cases, each test case contains only one positive integer N in one line. The number of digits of N is not exceeding 10,000, and N has not lead zeroes.
The input will finish with the end of file.
Output
For each the case, your program will output the least palindromic number P (P > N) on separate line.
Sample Input
44
3
175
Sample Output
55
4
181
求高手解答.
答案
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
热门考点