1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-18 11:36:48 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 12:43:11 +08:00
parent 58bbdfd57c
commit 2b0511d272
10721 changed files with 8123 additions and 8119 deletions

View File

@@ -0,0 +1,42 @@
<p>给你一个 32 位的有符号整数 <code>x</code> ,返回将 <code>x</code> 中的数字部分反转后的结果。</p>
<p>如果反转后整数超过 32 位的有符号整数的范围 <code>[2<sup>31</sup>,  2<sup>31 </sup> 1]</code> ,就返回 0。</p>
<strong>假设环境不允许存储 64 位整数(有符号或无符号)。</strong>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>x = 123
<strong>输出:</strong>321
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>x = -123
<strong>输出:</strong>-321
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>x = 120
<strong>输出:</strong>21
</pre>
<p><strong>示例 4</strong></p>
<pre>
<strong>输入:</strong>x = 0
<strong>输出:</strong>0
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>-2<sup>31</sup> <= x <= 2<sup>31</sup> - 1</code></li>
</ul>