标签:
就是个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; } };
[leetcode]Excel Sheet Column Title
标签:
原文地址:http://www.cnblogs.com/x1957/p/4176029.html