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
Solution: 相当于26进制转换
class Solution:
# @return a string
def convertToTitle(self, num):
result = ''
while num:
result = chr(ord('A') + (num-1)%26) + result
num = (num -1)/26
return result