26进制
class Solution { public: int titleToNumber(string s) { int n = 0; for (int i = 0; i < s.size(); i++) { n = n * 26 + s[i] - 'A' + 1; } return n; } };
Powered by: 博客园 Copyright © 2024 1957 Powered by .NET 9.0 on Kubernetes