Write a function that tells whether the natural number n is a palindromic number or not.
Interface
C++ | bool is_palindromic(int n); |
C | int is_palindromic(int n); |
Java | public static boolean isPalindromic(int n); |
Python | is_palindromic(n) # returns bool |
is_palindromic(n: int) -> bool |
Precondition
n is a natural number.
Observation You only need to submit the required procedure; your main program will be ignored.
Input/Output