大于N的最小回文数

给定一个正整数N,任务是找到大于N的最小回文数。回文数是指正读反读都相同的数字,例如121、44。题目保证N的位数不超过10,000且不带前导零。" 97679959,8669781,CuTest:C语言轻量级单元测试框架解析,"['测试', 'c/c++', '数据结构与算法']
摘要由CSDN通过智能技术生成

题目描述

    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.

输入

    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.

输出

    For each the case, your program will output the least palindromic number P (P > N) on separate line.

样例输入

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值