1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-26 02:00:27 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/Excel表列名称 [excel-sheet-column-title].html

53 lines
842 B
HTML
Raw Normal View History

2022-03-27 20:56:26 +08:00
<p>给你一个整数 <code>columnNumber</code> ,返回它在 Excel 表中相对应的列名称。</p>
<p>例如:</p>
<pre>
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
</pre>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>columnNumber = 1
<strong>输出:</strong>"A"
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>columnNumber = 28
<strong>输出:</strong>"AB"
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>columnNumber = 701
<strong>输出:</strong>"ZY"
</pre>
<p><strong>示例 4</strong></p>
<pre>
<strong>输入:</strong>columnNumber = 2147483647
<strong>输出:</strong>"FXSHRXW"
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= columnNumber <= 2<sup>31</sup> - 1</code></li>
</ul>