#168. Excel Sheet Column Title 题目链接
由于A对应1,Z对应26,所以每次n先减一,然后插入到字符串最前面
public class Solution {
public String convertToTitle(int n) {
StringBuilder sb = new StringBuilder();
while (n > 0) {
n--;
sb.insert(0, (char)(n % 26 + 'A'));
n /= 26;
}
return sb.toString();
}
}