171. Excel Sheet Column Number

时间:2018-05-22 12:02:49   收藏:0   阅读:142
 1 static int wing=[]()
 2 {
 3     std::ios::sync_with_stdio(false);
 4     cin.tie(NULL);
 5     return 0;
 6 }();
 7 
 8 class Solution 
 9 {
10 public:
11     int titleToNumber(string s) 
12     {
13         int res=0;     
14         for(char c:s)
15             res=res*26+(c-A+1);
16         return res;
17     }
18 };

二十六进制转十进制,比较简单

原文:https://www.cnblogs.com/zhuangbijingdeboke/p/9070609.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!