#K5391. Check if an Integer is a Palindrome
Check if an Integer is a Palindrome
Check if an Integer is a Palindrome
Given an integer \( n \), determine whether it is a palindromic number. An integer is a palindrome when it reads the same backward as forward. Note that negative numbers are not considered palindromic.
The goal of this problem is to implement an efficient algorithm to check if the given number is a palindrome. The solution must read input from standard input and write the result to standard output.
For example, \( n = 121 \) is a palindrome, while \( n = -121 \) is not.
inputFormat
The input consists of a single line containing an integer \( n \) (\( -10^9 \leq n \leq 10^9 \)).
outputFormat
Output a single line containing either True
if \( n \) is a palindrome or False
otherwise.
121
True