[BOJ 15122] Forbidden Zero

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 512M

Problem type
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

You’re writing the positive integers in increasing order starting from one. But you’ve never learned the digit zero, and thus omit any number that contains a zero in any position. The first ten integers you write are: 1, 2, 3, 4, 5, 6, 7, 8, 9, and 11.</p>

You have just written down the integer n (which is guaranteed to not contain the digit zero). What will be the next integer that you write down?

입력 형식

The input consists of a single line containing the integer n (1 ≤ n ≤ 999,999).</p>

It is guaranteed that n does not contain the digit zero.

출력 형식

Print, on a single line, the next integer you will be writing down.

예제 입력 1

99

예제 출력 1

111

예제 입력 2

1234

예제 출력 2

1235

Comments

There are no comments at the moment.