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

    Example 1: Input: 1 Output: “A”Example 2: Input: 28 Output: “AB”Example 3: Input: 701 Output: “ZY”
    Runtime: 0 ms, faster than 100.00% of C++ online submissions for Excel Sheet Column Title.

    1. class Solution {
    2. public:
    3. string convertToTitle(int n) {
    4. string result = "";
    5. while(n) {
    6. result = (char) (--n % 26 + 'A') + result;
    7. n = n /26;
    8. }
    9. return result;
    10. }
    11. };

    典型的进制转换问题,需要注意的是这里是 27 进制,因为最小的“数字”是 Z(26),然后通过 ASCII 码的相关运算还原为字母