Palindrome Number
Check if an integer is a palindrome: a number that reads the same forwards and backwards.
Negative numbers are never palindromes (because of the minus sign). Single-digit numbers are always palindromes.
Input
- Line 1: a single integer (any
intvalue, from -2^31 to 2^31 - 1)
Output
trueif the number is a palindrome,falseotherwise.
Examples
Input:
121
Output:
true
Input:
-121
Output:
false
Input:
10
Output:
false
Input:
0
Output:
true
A single-digit number, including 0, always reads the same both ways.
Input:
12321
Output:
true