#P1307. [NOIP 2011 普及组] 数字反转

[NOIP 2011 普及组] 数字反转

Description

Given an integer NN, 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.

123
321
-380
-83

Hint

【Constraints】

1,000,000,000N1,000,000,000-1,000,000,000\leq N\leq 1,000,000,000.

NOIP 2011 Junior Problem 1.

Translated by ChatGPT 5