https://leetcode.com/problems/excel-sheet-column-number/

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

  

Leetcode 171 Excel Sheet Column Number 难度:0的更多相关文章

  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 python

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

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

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

  8. LeetCode 171 Excel Sheet Column Number

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

  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. java mybatis 中sql 模糊查询

    示例: like concat('%',#{groupName},'%') //-------------- <select id="findList" resultType ...

  2. Coursera台大机器学习基础课程学习笔记1 -- 机器学习定义及PLA算法

    最近在跟台大的这个课程,觉得不错,想把学习笔记发出来跟大家分享下,有错误希望大家指正. 一机器学习是什么? 感觉和 Tom M. Mitchell的定义几乎一致, A computer program ...

  3. PAT乙级 1033. 旧键盘打字(20)

    1033. 旧键盘打字(20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 旧键盘上坏了几个键,于是在敲一段文 ...

  4. C#中把Datatable转换为Json的5个代码实例

    一. /// <summary> /// Datatable转换为Json /// </summary> /// <param name="table" ...

  5. 文件上传插件uploadify详解

    官网:http://www.uploadify.com/ 基于jquery的文件上传控件,支持ajax无刷新上传,多个文件同时上传,上传进行进度显示,删除已上传文件. 要求使用jquery1.4或以上 ...

  6. 【转】PowerShell入门(三):如何快速地掌握PowerShell?

    转至:http://www.cnblogs.com/ceachy/archive/2013/02/01/HowToLearnPowerShell.html 如何快速地掌握PowerShell呢?总的来 ...

  7. 让hadoop-0.20.2自带的eclipse插件支持eclipse-3.5以上

    hadoop-0.20.2自带的eclipse插件是不支持eclipse-3.5以上的,要想让它支持3.5以上就必须重新编译eclipse插件. 首先先修改  hadoop-0.20.2\src\co ...

  8. html5 Web Storage(localStorage(),sessionStorage())

    Web Storage包括了两种存储方式:sessionStorage和localStorage sessionStorage 是会话级别的存储,这些数据只有在同一个会话中的页面才能访问并且当会话结束 ...

  9. MAC: Homebrew(代替yum)安装

    安装    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"    最新方式请 ...

  10. C# 使用 Abot 实现 爬虫 抓取网页信息 源码下载

    下载地址 ** dome **