1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/千位分隔数 [thousand-separator].html
2022-03-29 12:43:11 +08:00

36 lines
806 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数&nbsp;<code>n</code>,请你每隔三位添加点(即 &quot;.&quot; 符号)作为千位分隔符,并将结果以字符串格式返回。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>n = 987
<strong>输出:</strong>&quot;987&quot;
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>n = 1234
<strong>输出:</strong>&quot;1.234&quot;
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>n = 123456789
<strong>输出:</strong>&quot;123.456.789&quot;
</pre>
<p><strong>示例 4</strong></p>
<pre><strong>输入:</strong>n = 0
<strong>输出:</strong>&quot;0&quot;
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= n &lt; 2^31</code></li>
</ul>