Mock CCC '18 Contest 1 J1 - A String Problem

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 1G

Problem type

Given a positive integer N with no zeroes in its base-10 representation, compute the smallest positive integer greater than N with no zeroes in its base-10 representation.

Constraints

1N999999

N will not contain the digit zero in its base-10 representation.

Input Specification

The input consists of a single line containing the integer N.

Output Specification

Print, on a single line, the smallest positive integer greater than N with no zeroes in its base-10 representation.

Sample Input 1

Copy
99

Sample Output 1

Copy
111

Sample Input 2

Copy
1234

Sample Output 2

Copy
1235

Comments

There are no comments at the moment.