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

    ID: 2119 远端评测题 1000ms 128MiB 尝试: 2 已通过: 2 显示难度入门 上传者: 标签>模拟字符串2011NOIP 普及组

[NOIP 2011 普及组] 数字反转

Problem 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