P1307 [NOIP 2011 Junior] Digit Reversal

Description

Given an integer $N$, reverse its digits to obtain a new number. The new number should also follow the usual form of integers: unless the original number is zero, the leading digit of the reversed number must not be zero (see Sample 2).

Input Format

A single integer N.

Output Format

A single integer, which is the reversed number.

Explanation/Hint

【Constraints】 $-1,000,000,000\leq N\leq 1,000,000,000$. NOIP 2011 Junior Problem 1. Translated by ChatGPT 5