# leetcode:数学：Excel Sheet Column Numbe（171）

Related to question Excel Sheet Column Title

Given a column title as appear in an Excel sheet, return its corresponding column number.

For example:

A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28

class Solution {
public:
int titleToNumber(string s) {
int col = 0;
for (char i : s)
col = col * 26 + (i - 'A' + 1);
return col;
}
};

• 本文已收录于以下专栏：

## Leetcode 171. Excel Sheet Column Number

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return...

## <LeetCode OJ> 171 / 168 Excel Sheet Column Number & Title

171. Excel Sheet Column Number My Submissions Question Total Accepted: 58671 Total Submissions: ...

## LeetCode之路：171. Excel Sheet Column Number

LeetCode之路：171. Excel Sheet Column Number 一、引言这道题相对来说比较简单，但是背后涉及到的东西确实挺有意思的： 我才知道 Excel 的列的表示是用的类似...

## LeetCodeOJ_171_Excel Sheet Column Number

Given a column title as appear in an Excel sheet, return its corresponding column number.

## 171. Excel Sheet Column Number\172. Factorial Trailing Zeroes\134. Gas Station\135. Candy

Excel Sheet Column Number 题目描述 代码实现 Factorial Trailing Zeroes 题目描述 代码实现 Gas Station 题目描述 代码实现 Candy ...

## [LeetCode]--168. Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For exam...

## [C++]LeetCode: 57 Excel Sheet Column Title

举报原因： 您举报文章：leetcode:数学：Excel Sheet Column Numbe（171） 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)