168. Excel Sheet Column Title
code
class Solution { public: string convertToTitle(int n) { char tmp; string ans; while(n) { n-=1; tmp = 'A' + n%26; ans = tmp + ans; n /= 26; } return ans; } };
https://leetcode.com/problems/excel-sheet-column-title/description/