#K59772. Reverse the Digits

    ID: 30939 Type: Default 1000ms 256MiB

Reverse the Digits

Reverse the Digits

Given a positive integer \( n \), your task is to reverse its digits. The reversed number should ignore any leading zeros. For example, if \( n = 1200 \), the reversed number is 21 because the zeros at the beginning are dropped in the reversal process.

More formally, if \( n \) is represented in its decimal form as \( d_kd_{k-1}\ldots d_1 \) (with \( d_k \) being the most significant digit), then the output should be the integer obtained by \( \text{reverse}(n) = d_1d_2\ldots d_k \) with any leading zeros removed.

Examples:

  • If \( n = 1234 \), then \( \text{reverse}(1234) = 4321 \).
  • If \( n = 1200 \), then \( \text{reverse}(1200) = 21 \).
  • If \( n = 1001 \), then \( \text{reverse}(1001) = 1001 \).

inputFormat

The input consists of a single positive integer \( n \) (\( 1 \le n \le 10^9 \)). The input is read from standard input.

outputFormat

Output the reversed integer. The result should be printed to standard output.

## sample
1234
4321