点击打开链接
class Solution {
public:
string convertToTitle(int n) {
string res="";
int temp =0;
while(n>0){
temp = (n-1)%26;
if(temp>=0) res += 'A'+temp;
n = (n-1)/26;
}
reverse(res.begin(), res.end());
return res;
}
};