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
Credits:
Special thanks to @ifanchu for adding this problem and creating all test cases.
Show Tags
代码:
public class Solution {
public String convertToTitle(int n) {
char[] ss = new char[100];
int[] num = new int[100];
for (int i = 0 ; i < 100; i++)
{
num[i] = -1;
}
int count = 0;
num[count++] = n % 26;
int temp = n / 26;