Functions
Function-38
Function-39
Function-40
~/algor $ cat problems/funksiya-teskari-son
Reversed number function
Easy
1000 ms
128 MB
30%
Write a function Reverse(n) that returns the number obtained by writing the digits of the positive integer $n$ in reverse order. Leading zeros are dropped.
Example 1: Reverse(123) → 321
Example 2: Reverse(1200) → 21 — the leading zeros of $0021$ are dropped.
Write only the function body.
Input
One line with a positive integer $n$ — the argument of the function.
Output
The value returned by the function: an integer.
Note
$1 \le n \le 10^{9}$
Examples
Input #1
123
Output #1
321
Input #2
1200
Output #2
21