#P10732. Detecting Palindromic Numbers
Detecting Palindromic Numbers
Detecting Palindromic Numbers
Given two integers S and E, iterate through each integer in the inclusive interval \([S, E]\). For each integer, check whether its decimal representation is a palindrome. A number is considered a palindrome if its representation is the same when reversed, i.e., if \(\text{num} = \text{reverse}(\text{num})\). If the number is a palindrome, output Palindrome!
(including the exclamation mark), otherwise output the number itself.
inputFormat
The input consists of a single line containing two space-separated integers S and E (with S \(\le\) E) representing the starting and ending values of the interval.
outputFormat
For each integer in the interval from S to E (inclusive), output either the number itself (if it is not a palindrome) or Palindrome!
if it is. Each output should be on a separate line.
sample
10 12
10
Palindrome!
12
</p>