Excel Sheet Column Number || leetcode
很简单的26进制问题
int titleToNumber(char* s) { int sum=0,temp; char *p=s; while(*p!='\0'){ sum=sum*26+(*p-'A'+1); p++; } return sum; }
很简单的26进制问题
int titleToNumber(char* s) { int sum=0,temp; char *p=s; while(*p!='\0'){ sum=sum*26+(*p-'A'+1); p++; } return sum; }