Capicues 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

Feu una funció que digui si un natural n és capicua o no.

Interfície

C++
bool es_capicua(int n);
C
int es_capicua(int n);
Java
public static boolean esCapicua(int n);
Python
es_capicua(n) # returns bool
 
es_capicua(n: int) -> bool

Precondició

n és un natural.

Observació Només cal enviar el procediment demanat; el programa principal serà ignorat.

Public test cases
  • Input/Output

    es_capicua(12321) → true
    es_capicua(0) → true
    es_capicua(4004) → true
    es_capicua(12) → false
    es_capicua(100201) → false
  • Information
    Author
    Salvador Roura
    Language
    Catalan
    Other languages
    English
    Official solutions
    C C++ Java Python
    User solutions
    C++