@@ -0,0 +1,1231 @@
+/**%0A *%09Given a positive integer, return its corresponding column title as appear in an Excel sheet.%0A *%0A *%09For example:%0A *%0A *  1 -%3E A%0A *  2 -%3E B%0A *  3 -%3E C%0A *   ...%0A *  26 -%3E Z%0A *  27 -%3E AA%0A *  28 -%3E AB %0A *%0A *%09Author: matao%0A */%0A%0Apublic class ExcelSheetColumnTitle %7B%0A%09public static String convertToTitle(int n) %7B%0A        String s = null;%0A%09%09StringBuilder sb = new StringBuilder();%0A        do %7B%0A            n = n - 1;%0A        %09int remain = n %25 26;%0A        %09char c = (char)('A' + remain);%0A        %09sb.append(c);%0A        %09n = n / 26;%0A        %7D while (n != 0);%0A        s = reverseString(sb.toString());%0A        return s;%0A    %7D%0A    %0A    public static String reverseString(String s) %7B%0A    %09char%5B%5D c = s.toCharArray();%0A    %09for(int i = 0, j = s.length() - 1; i %3C j; i++, j--) %7B%0A    %09%09char temp = c%5Bi%5D;%0A    %09%09c%5Bi%5D = c%5Bj%5D;%0A    %09%09c%5Bj%5D = temp;%0A    %09%7D%0A    %09return new String(c);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09System.out.println(convertToTitle(1));   // A%0A    %09System.out.println(convertToTitle(24));  // X%0A    %09System.out.println(convertToTitle(25));  // Y%0A    %09System.out.println(convertToTitle(26));%09 // Z%0A    %09System.out.println(convertToTitle(27));  // AA%0A    %09System.out.println(convertToTitle(28));  // AB%0A    %7D%0A%7D

add Excel Sheet Column Title solution