点击打开链接
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;
}
};
最后
以上就是爱笑服饰最近收集整理的关于leetcode+ 数字准换位字母,进制转换的全部内容,更多相关leetcode+内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复