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
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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

1 \le N \le 999\,999

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

99

Sample Output

111

Sample Input

1234

Sample Output

1235

Comments

There are no comments at the moment.