1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/将整数转换为两个无零整数的和 [convert-integer-to-the-sum-of-two-no-zero-integers].html
2022-03-29 12:43:11 +08:00

54 lines
1.3 KiB
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>「无零整数」是十进制表示中 <strong>不含任何 0</strong>&nbsp;的正整数。</p>
<p>给你一个整数&nbsp;<code>n</code>,请你返回一个 <strong>由两个整数组成的列表</strong> <code>[A, B]</code>,满足:</p>
<ul>
<li><code>A</code><code>B</code>&nbsp;都是无零整数</li>
<li><code>A + B = n</code></li>
</ul>
<p>题目数据保证至少有一个有效的解决方案。</p>
<p>如果存在多个有效解决方案,你可以返回其中任意一个。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>n = 2
<strong>输出:</strong>[1,1]
<strong>解释:</strong>A = 1, B = 1. A + B = n 并且 A 和 B 的十进制表示形式都不包含任何 0 。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>n = 11
<strong>输出:</strong>[2,9]
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>n = 10000
<strong>输出:</strong>[1,9999]
</pre>
<p><strong>示例 4</strong></p>
<pre><strong>输入:</strong>n = 69
<strong>输出:</strong>[1,68]
</pre>
<p><strong>示例 5</strong></p>
<pre><strong>输入:</strong>n = 1010
<strong>输出:</strong>[11,999]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>2 &lt;= n &lt;= 10^4</code></li>
</ul>