标签:
https://leetcode.com/problems/excel-sheet-column-number/
1 class Solution { 2 public: 3 int titleToNumber(string s) { 4 int size=s.size(); 5 int res=0;; 6 for(int i=0;i<size;i++) 7 { 8 res*=26; 9 int temp=s[i]-‘A‘+1; 10 res+=temp; 11 } 12 return res; 13 } 14 };
标签:
原文地址:http://www.cnblogs.com/aguai1992/p/4629595.html