很简单的26进制问题
int titleToNumber(char* s) {
int sum=0,temp;
char *p=s;
while(*p!='\0'){
sum=sum*26+(*p-'A'+1);
p++;
}
return sum;
}
2023-10-12 16:04:40
很简单的26进制问题
int titleToNumber(char* s) {
int sum=0,temp;
char *p=s;
while(*p!='\0'){
sum=sum*26+(*p-'A'+1);
p++;
}
return sum;
}