简答题:减一要注意
class Solution {
public:
string convertToTitle(int n) {
string res;
while(n){
n--;
res=char(65+n%26)+res;
n=n/26;
}
return res;
}
};
简答题:减一要注意
class Solution {
public:
string convertToTitle(int n) {
string res;
while(n){
n--;
res=char(65+n%26)+res;
n=n/26;
}
return res;
}
};