//用C编译器,不要用C++编译器
#include
#include
#include
#include
char mask[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int s26toi10(char *s){
char *p=s;
int l=strlen(s);
float sum=0;
while(*p)
sum+=(*p++-65)*pow(26,--l);
return (int)sum;
}
char* i10tos26(const int num){
int l=num,i=0;
while(l /= 26)
i++;
char *dest=(char*)malloc(i+1);
l=num;
while(l){
int s = l % 26;
l /= 26;
dest[i--]=mask[s];
}
return dest;
}
int main()
{
char *inputstr1="DH";
char *inputstr2="BCE";
int dec=s26toi10(inputstr1)+s26toi10(inputstr2);
//printf("%d",dec);
char *s=i10tos26(dec);
printf(s);
free(s);
return 0;
}