#C5644. House Number Reversal on Reversal Day
House Number Reversal on Reversal Day
House Number Reversal on Reversal Day
On Reversal Day, every house's number is transformed by reversing its digits and dropping any leading zeros that may appear after reversal. For example, if a house number is 450
, its reversed form is 54
because the leading zero in 054
is removed. Given the number of houses and a list of unique positive integers representing the house numbers, output the reversed numbers for each house.
The reversal of a number can be mathematically expressed as follows:
\[ \text{rev}(x) = \text{int}(\text{string}(x)[::-1]) \]
It is guaranteed that each number after reversal is processed by removing any leading zeros.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains a single integer \(n\) \( (1 \leq n \leq 10^5) \), representing the number of houses.
- The second line contains \(n\) space-separated positive integers representing the house numbers.
outputFormat
Output the reversed house numbers in one line separated by a single space. The output should be written to standard output (stdout).
## sample5
123 450 321 789 101
321 54 123 987 101