[LeetCode]Excel Sheet Column Title
2015-11-30 02:31
302 查看
这个题挺有意思的,要注意是从1开始的
public class Solution { public String convertToTitle(int n) { String result = ""; while (n > 0) { n = n - 1; int tmp = n % 26; result = (char)('A' + tmp) + result; n = n / 26; } return result; } }
相关文章推荐
- ubuntu关闭cups服务(631端口)
- ubuntu关闭cups服务(631端口)
- 【C#】简单工厂模式
- SQL总结(七)查询实战
- Ubuntu下安装Nginx
- 云树牵手阿里健康,合作打造心理健康服务平台
- 云树2.0:互联网+创新理念帮你解决心理困惑
- SQL总结(六)触发器
- 新博客地址
- SQL总结(五)存储过程
- SQL总结(四)编辑类
- 如何理解JavaScript中函数是第一类对象
- Unity3D引擎崩溃、异常、警告、BUG与提示总结
- windows mysql 自动备份的几种方法
- HTML表单练习
- 比较一下几种并发方式。
- MongoDB Windows环境安装及配置
- SQL总结(三)其他查询
- 项目第四周
- Mysql的实时同步 - 双机互备