In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of March 24th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]
Are you a perfectionist? Well, for Peter, a perfect number is a palindromic number, that is, is a number that remains the same when its digits are reversed. For instance, 16361 is palindromic, while 123 is not.
Write a program that, given several integers, indicates for each one if it is a palindromic number.
The first line of input contains an integer T, representing the number of test cases that follow.
Each of the following T lines contains one integer N, representing the number we want to check if it is palindromic.
The output should have exactly T lines, one per input test case.
Each of these lines should contain one of the following statements:
N: yes
if it is a palindromic number
N: no
if it is not a palindromic number
The following limits are guaranteed in all the test cases that will be given to your program:
1 ≤ T ≤ 10 | Number of test cases | |
1 ≤ N < 109 | Number to check if it is palindromic |
Additionally, it is guaranteed that none of the given integers N contains the digit 0
.
Example Input | Example Output |
4 12321 73 4565 5 |
12321: yes 73: no 4565: no 5: yes |