首页 > 代码库 > [leetcode]Excel Sheet Column Number

[leetcode]Excel Sheet Column Number

26进制

class Solution {public:    int titleToNumber(string s) {        int n = 0;        for (int i = 0; i < s.size(); i++) {            n = n * 26 + s[i] - A + 1;        }        return n;    }};

 

[leetcode]Excel Sheet Column Number