In this exercise, we say that a natural number is increasing if every digit is less than or equal to the digit which is on its right (if any).
Write a recursive function that tells if a natural number n is increasing or not.
Interface
C++ | bool is_increasing(int n); |
C | int is_increasing(int n); |
Java | public static boolean isIncreasing(int n); |
Python | is_increasing(n) # returns bool |
is_increasing(n: int) -> bool |
Observation You only need to submit the required procedure; your main program will be ignored.
Input/Output