给定一个Excel表格中的列名称,返回其相应的列序号。
示例:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
详见:https://leetcode.com/problems/excel-sheet-column-number/description/
class Solution { public: int titleToNumber(string s) { int num=0; for(int i=0;i<s.size();++i) { num=num*26+(s[i]-‘A‘+1); } return num; } };
详见:https://www.cnblogs.com/ganganloveu/p/4191180.html