mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-11-12 15:25:48 +08:00
38 lines
1.0 KiB
HTML
38 lines
1.0 KiB
HTML
<p>给你一个<strong>正整数</strong><code>n</code>。</p>
|
||
|
||
<p>返回一个整数,该整数是将 <code>n</code> 的十进制表示中所有的零都移除后得到的结果。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong class="example">示例 1:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong> <span class="example-io">n = 1020030</span></p>
|
||
|
||
<p><strong>输出:</strong> <span class="example-io">123</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>从 1<strong><u>0</u></strong>2<strong><u>00</u></strong>3<strong><u>0</u></strong> 中移除所有的零后,得到 123。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong> <span class="example-io">n = 1</span></p>
|
||
|
||
<p><strong>输出:</strong> <span class="example-io">1</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>1 的十进制表示中没有零,因此结果为 1。</p>
|
||
</div>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= n <= 10<sup>15</sup></code></li>
|
||
</ul>
|