1. Excel Sheet Column Title

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

For example:

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

Java实现:

public static String convertToTitle(int n) {
StringBuilder sb = new StringBuilder(); while (n-- != 0){
sb.append((char)(n%26+'A'));
n = n/26;
} return sb.reverse().toString(); }

168. Excel Sheet Column Title的更多相关文章

  1. [LeetCode] 168. Excel Sheet Column Title 求Excel表列名称

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

  2. leetcode 168. Excel Sheet Column Title 171 Excel Sheet Column Number

    题目 //像10进制一样进行 转换   只是要从0开始记录 class Solution { public: string convertToTitle(int n) { char a; string ...

  3. LeetCode 168. Excel Sheet Column Title

    Given a positive integer, return its corresponding column title as appear in an Excel sheet. -> A ...

  4. ✡ leetcode 168. Excel Sheet Column Title 26进制数字 --------- java

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

  5. Java for LeetCode 168 Excel Sheet Column Title

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

  6. Java [Leetcode 168]Excel Sheet Column Title

    题目描述: Given a positive integer, return its corresponding column title as appear in an Excel sheet. F ...

  7. 【LeetCode】168. Excel Sheet Column Title

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

  8. 168. Excel Sheet Column Title (Math)

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

  9. 168. Excel Sheet Column Title 由数字返回excel的标题

    [抄题]: Given a positive integer, return its corresponding column title as appear in an Excel sheet. F ...

随机推荐

  1. 开源YYKit-b

    转自 ibireme的博客,大家可以去他博客看看,有很多开发过程的一些调研和评测. YYModel 类似 Mantle/JSONModel 的工具,性能比 Mantle 高一个数量级,有更好的容错性, ...

  2. 苹果Mac操作系统下怎么显示隐藏文件

      对于新手而已民,苹果的MAC操作系统刚用时用得很不习惯,比如想要显示被隐藏的文件时,不像windows有个“文件夹选项”对话框可以来设置,百度出来的结果都是用命令来操作,但我建议不要用命令去操作, ...

  3. submit和button提交表单的区别

    <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo ...

  4. c++ 16 this 和 继承 及继承机制中的构造函数 与 析构函数

    #include <iostream> #include <string> using namespace std; class Animal { public: Animal ...

  5. tomcat部署javaweb项目的三种方式

    一.将项目文件夹或war包直接拷贝到tomcat的webapps下 二.在Tomcat\conf\Catalina\localhost下建立xml文件 修改内容如下<Context path=& ...

  6. Java IO3:字符流

    字符流 字节流提供了处理任何类型输入/输出操作的功能(对于计算机而言,一切都是0 和1,只需把数据以字节形式表示就够了),但它们不可以直接操作Unicode字符,一个Unicode字符占用2个字节,而 ...

  7. POJ2253——Frogger(Floyd变形)

    Frogger DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fi ...

  8. UVA548——Tree(中后序建树+DFS)

    Tree You are to determine the value of the leaf node in a given binary tree that is the terminal nod ...

  9. Android ActionBar通过Tab进行不同的Fragment之间的交换

    ActionBar的使用常见于4.0系统,其Tab的使用挺广泛的. 在ActionBar中添加标签(Tabs),每个标签对应的是一个Fragment,点击不同的Tab时,就会切换到对应的Fragmen ...

  10. Android之AlertDialog.Builder详解

    import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; ...