#K57052. Palindromic Number Checker
Palindromic Number Checker
Palindromic Number Checker
You are given an integer t
denoting the number of test cases. For each test case, you are given a single integer n
.
Your task is to determine whether the integer is a palindrome. A number is said to be a palindrome if its decimal representation reads the same from left to right and from right to left. In mathematical terms, a number n is a palindrome if:
$$ n = \text{reverse}(n) $$For example, 121 is a palindrome while 123 is not.
inputFormat
The first line contains an integer t
- the number of test cases.
Each of the next t
lines contains a single integer n
.
outputFormat
For each test case, output a single line containing YES
if n
is a palindrome, otherwise print NO
.
3
121
123
22
YES
NO
YES
</p>