就是个26进制
class Solution { public: string convertToTitle(int n) { string ans = ""; while(n) { ans = string(1, ((n - 1) % 26 + 'A')) + ans; n = (n - 1) / 26; } return ans; } };
Powered by: 博客园 Copyright © 2024 1957 Powered by .NET 9.0 on Kubernetes