[leetcode]Excel Sheet Column Title

就是个26进制

class Solution {
public:
    string convertToTitle(int n) {
        string ans = "";
        while(n) {
            ans = string(1, ((n - 1) % 26 + 'A')) + ans;
            n = (n - 1) / 26;
        }
        return ans;
    }
};
原文地址:https://www.cnblogs.com/x1957/p/4176029.html