本质是把26进制转化为10进制

    A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
 class Solution {
public:
int titleToNumber(string s) {
int ans = ;
for(int i = ; i<s.size(); ++i){
ans = * ans + s[i] - 'A' + ;
}
return ans;
}
};

Leetcode 171 Excel Sheet Column Number 字符串处理的更多相关文章

  1. [LeetCode] 171. Excel Sheet Column Number 求Excel表列序号

    Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, retur ...

  2. LeetCode 171. Excel Sheet Column Number (Excel 表格列数字)

    Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, retur ...

  3. ✡ leetcode 171. Excel Sheet Column Number 字母转换为数字 --------- java

    Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, retur ...

  4. Java for LeetCode 171 Excel Sheet Column Number

    Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, retur ...

  5. LeetCode: 171 Excel Sheet Column Number(easy)

    题目: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, r ...

  6. LeetCode 171 Excel Sheet Column Number 解题报告

    题目要求 Given a column title as appear in an Excel sheet, return its corresponding column number. For e ...

  7. LeetCode 171 Excel Sheet Column Number

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

  8. Leetcode 171 Excel Sheet Column Number python

    题目: Given a column title as appear in an Excel sheet, return its corresponding column number. For ex ...

  9. 20. leetcode 171. Excel Sheet Column Number

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

随机推荐

  1. squeeze() 函数——MATLAB

    B=squeeze(A) 移除张量A的单一维,即返回和矩阵A元素相同,但所有单一维都移除的矩阵B,单一维是满足size(A,dim)=1的维. squeeze命令对二维数组是不起作用的; 如果A是一行 ...

  2. ARM+linux学习过程(2)安装vmware-tool过程与错误解决

    安装: 点击Ubuntu VMware菜单的-VM-Install VMware Tools 这时,在Ubuntu下会自动加载Linux版的VMware Tools的安装光盘镜像.你会看到虚拟机的桌面 ...

  3. Windows平台CUDA开发之前的准备工作

    CUDA是NVIDIA的GPU开发工具,眼下在大规模并行计算领域有着广泛应用. windows平台上面的CUDA开发之前.最好去NVIDIA官网查看说明,然后下载对应的driver. ToolKits ...

  4. (十)RabbitMQ消息队列-高可用集群部署实战

    原文:(十)RabbitMQ消息队列-高可用集群部署实战 前几章讲到RabbitMQ单主机模式的搭建和使用,我们在实际生产环境中出于对性能还有可用性的考虑会采用集群的模式来部署RabbitMQ. Ra ...

  5. LOG4J中日志级别的使用

    <logger name="demo-log" additivity="false"> <level value="${log.le ...

  6. 将Sublime Text2 加入右键菜单

    在googleread里面看有人推荐sublime text2.说开发很方便.就下载一个试试.写html还真的挺爽. 于是按照vim加入鼠标右键的方法.果然可以.这里和大家分享 1. 运行中输入 re ...

  7. c# 调用ArcEngine的GP工具

    转自原文c# 调用ArcEngine的GP工具,AE调用GP工具 IAoInitialize m_AoInitialize = new AoInitializeClass(); esriLicense ...

  8. [Compose] 16. Apply multiple functors as arguments to a function (Applicatives)

    We find a couple of DOM nodes that may or may not exist and run a calculation on the page height usi ...

  9. Gibbs 采样的应用

    Gibbs 采样的最大作用在于使得对高维连续概率分布的抽样由复杂变得简单. 可能的应用: 计算高维连续概率分布函数的数学期望, Gibbs 采样得到 n 个值,再取均值: 比如用于 RBM:

  10. Color the ball(杭电1556)

    Color the ball Time Limit : 9000/3000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Tota ...