Excel Sheet Column Number

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 n=s.length();
int result=;
for(int i=;i<n;i++)
{
int num=s[i]-'A'+;
result=result*+num;
} return result;
}
};

【leetcode】Excel Sheet Column Number的更多相关文章

  1. 【LeetCode】Excel Sheet Column Number(Excel表列序号)

    这道题是LeetCode里的第171道题. 题目描述: 给定一个Excel表格中的列名称,返回其相应的列序号. 例如, A -> 1 B -> 2 C -> 3 ... Z -> ...

  2. 【leetcode】Excel Sheet Column Title & Excel Sheet Column Number

    题目描述: Excel Sheet Column Title Given a positive integer, return its corresponding column title as ap ...

  3. 【leetcode】Excel Sheet Column Title

    Excel Sheet Column Title Given a non-zero positive integer, return its corresponding column title as ...

  4. 【leetcode】Excel Sheet Column Title & Excel Sheet Column Number (easy)

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

  5. [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 ...

  6. 【leetcode刷题笔记】Excel Sheet Column Number

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

  7. 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 ...

  8. ✡ 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 ...

  9. 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 ...

随机推荐

  1. PHP ADLogin

    <?php $user = 'aaaa'; $password = 'xxxx'; $domain = 'b.a.com'; //设定域名 $port = 3268; $basedn = 'dc ...

  2. onethink常用标签的使用示例

    首页文章模型列表输出: <article:list name="article" category="2" row="3" order ...

  3. 【BZOJ】3527: [Zjoi2014]力(fft+卷积)

    http://www.lydsy.com/JudgeOnline/problem.php?id=3527 好好的一道模板题,我自己被自己坑了好久.. 首先题目看错.......什么玩意.......首 ...

  4. ES6 你可能不知道的事 – 基础篇

    序 ES6,或许应该叫 ES2015(2015 年 6 月正式发布),对于大多数前端同学都不陌生. 首先这篇文章不是工具书,不会去过多谈概念,而是想聊聊关于每个特性 你可能不知道的事,希望能为各位同学 ...

  5. BZOJ4034 T2

    Description 有一棵点数为 N 的树,以点 1 为根,且树点有边权.然后有 M 个操作,分为三种: 操作 1 :把某个节点 x 的点权增加 a . 操作 2 :把某个节点 x 为根的子树中所 ...

  6. POJ2288 Islands and Bridges

    Description Given a map of islands and bridges that connect these islands, a Hamilton path, as we al ...

  7. OPENSSL编程入门学习

    相关学习资料 http://bbs.pediy.com/showthread.php?t=92649 https://www.openssl.org https://www.google.com.hk ...

  8. POJ 3273 Monthly Expense

    传送门 Time Limit: 2000MS Memory Limit: 65536K Description Farmer John is an astounding accounting wiza ...

  9. The C Programming Language (second edition) 实践代码(置于此以作备份)

    1. #include <stdio.h> #include <stdlib.h> #include <math.h> #include<time.h> ...

  10. Centos 5.x/6.x 配置163网易yum源

    Centos系统默认都是系统自带的yum源,国内用户用yum源安装比较慢,为了提高效率,一般我们会配置国内的yum源.国内比较好的yum源有网易yum源.搜狐yum源等. 我感觉网易的yum源比较好用 ...