#P4850. Chewbacca and Number
Chewbacca and Number
Chewbaсca and Number
题面翻译
Luke Skywalker给了Chewbacca一个正整数 ,但是Chewbacca决定把这个数改掉。他可以把整数 每个位置上的数 改成 。 请你帮助Chewbacca来计算一下,如何把 改成一个最小的正整数,注意,不能出现首位为 的情况。
输入范围
输入一个正整数 ,表示初始的数。
输出范围
输出最小可以改变的数,注意不能出现首位为 的情况。
感谢@馒头精 提供的翻译
题目描述
Luke Skywalker gave Chewbacca an integer number . Chewbacca isn't good at numbers but he loves inverting digits in them. Inverting digit means replacing it with digit .
Help Chewbacca to transform the initial number to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn't start with a zero.
输入格式
The first line contains a single integer — the number that Luke Skywalker gave to Chewbacca.
输出格式
Print the minimum possible positive number that Chewbacca can obtain after inverting some digits. The number shouldn't contain leading zeroes.
样例 #1
样例输入 #1
27
样例输出 #1
22
样例 #2
样例输入 #2
4545
样例输出 #2
4444