hdu 2100
#include<stdio.h>
#include<string.h>
char a[300],b[300];
int a1[300],b1[300];
int main() {
int i,j,k,c[300],suma,sumb,lena,lenb;
while(scanf("%s%s",a,b)!=EOF) {
lena=strlen(a);
lenb=strlen(b);
memset(a1,0,sizeof(a1));
memset(b1,0,sizeof(b1));
j=0;
for(i=lena-1;i>=0;i--)
a1[j++]=a[i]-'A';
j=0;
for(i=lenb-1;i>=0;i--)
b1[j++]=b[i]-'A';
for(i=0;i<280;i++) {
a1[i]+=b1[i];
if(a1[i]>25) {
a1[i+1]++;
a1[i]=a1[i]%26;
}
}
k=0;
for(i=280;i>=0;i--) {
if(k)
printf("%c",a1[i]+'A');
else
if(a1[i]) {
k=1;
printf("%c",a1[i]+'A');
}
}
if(k==0)
printf("A");
printf("\n");
}
return 0;
}
#include<string.h>
char a[300],b[300];
int a1[300],b1[300];
int main() {
int i,j,k,c[300],suma,sumb,lena,lenb;
while(scanf("%s%s",a,b)!=EOF) {
lena=strlen(a);
lenb=strlen(b);
memset(a1,0,sizeof(a1));
memset(b1,0,sizeof(b1));
j=0;
for(i=lena-1;i>=0;i--)
a1[j++]=a[i]-'A';
j=0;
for(i=lenb-1;i>=0;i--)
b1[j++]=b[i]-'A';
for(i=0;i<280;i++) {
a1[i]+=b1[i];
if(a1[i]>25) {
a1[i+1]++;
a1[i]=a1[i]%26;
}
}
k=0;
for(i=280;i>=0;i--) {
if(k)
printf("%c",a1[i]+'A');
else
if(a1[i]) {
k=1;
printf("%c",a1[i]+'A');
}
}
if(k==0)
printf("A");
printf("\n");
}
return 0;
}