Palindromic numbers P76229


Warning: Deprecated problem

This problem is marked as deprecated.

Although this problem remains in the system because of historic reasons, it may have some issues and should not be used anymore.

Deprecation indication: Please use P77686 instead.

Statement
 

pdf   zip   main.cc   main.c   main.java   main.py

html

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.

Public test cases
  • Input/Output

    is_palindromic(12321) → true
    is_palindromic(0) → true
    is_palindromic(4004) → true
    is_palindromic(12) → false
    is_palindromic(100201) → false
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C C++ Java Python
    User solutions
    C++