leetcode-Excel Sheet Column Title

Posted Shirley_ICT

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了leetcode-Excel Sheet Column Title相关的知识,希望对你有一定的参考价值。

题目链接:https://leetcode.com/problems/excel-sheet-column-title/

代码如下:

class Solution {
public:
    string convertToTitle(int n) {
        string ans("");
        while(n > 0)
        {
            int digit = n % 26;
            if(digit == 0)
            {
                digit = 26;
            }
            ans = (char)(A + digit - 1) + ans;
            n = (n - 1) / 26;
        }
        return ans;
    }
};

 

以上是关于leetcode-Excel Sheet Column Title的主要内容,如果未能解决你的问题,请参考以下文章

vuepress build提示YAMLException: end of the stream or a document separator is expected at line 7, colu

vuepress build提示YAMLException: end of the stream or a document separator is expected at line 7, colu

在excel的sheet1中输入数据,怎样同步备份到sheet2中,且sheet1的数据更新时,sheet2的备份只新增而不覆盖

vba 根据sheet名称查找数据 急!在线等!

构建块三对角矩阵

easypoi导出单个sheet和多个sheet