给你一个整数 $X$。请找出由与 $X$ 相同的数字组成且大于 $X$ 的最小整数。
输入格式
输入的第一行包含一个整数 $X$ ($1 \le X \le 999999$)。
$X$ 的最高位数字不会是 $0$。
输出格式
在单行中输出结果。如果不存在这样的数,则输出 $0$。
样例
输入样例 1
156
输出样例 1
165
输入样例 2
330
输出样例 2
0
输入样例 3
27711
输出样例 3
71127
给你一个整数 $X$。请找出由与 $X$ 相同的数字组成且大于 $X$ 的最小整数。
输入的第一行包含一个整数 $X$ ($1 \le X \le 999999$)。
$X$ 的最高位数字不会是 $0$。
在单行中输出结果。如果不存在这样的数,则输出 $0$。
156
165
330
0
27711
71127
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: