mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
36 lines
806 B
HTML
36 lines
806 B
HTML
|
<p>给你一个整数 <code>n</code>,请你每隔三位添加点(即 "." 符号)作为千位分隔符,并将结果以字符串格式返回。</p>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>示例 1:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>n = 987
|
|||
|
<strong>输出:</strong>"987"
|
|||
|
</pre>
|
|||
|
|
|||
|
<p><strong>示例 2:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>n = 1234
|
|||
|
<strong>输出:</strong>"1.234"
|
|||
|
</pre>
|
|||
|
|
|||
|
<p><strong>示例 3:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>n = 123456789
|
|||
|
<strong>输出:</strong>"123.456.789"
|
|||
|
</pre>
|
|||
|
|
|||
|
<p><strong>示例 4:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>n = 0
|
|||
|
<strong>输出:</strong>"0"
|
|||
|
</pre>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>提示:</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><code>0 <= n < 2^31</code></li>
|
|||
|
</ul>
|