# include <stdio.h>
# include <string.h>
int main(){
char str1[1000],str2[1000];
char str3[1000],str4[1000];
char result[1000];
char result2[1000];
int k1,k2,i,c = 0,k3 = 0,k4 = 0,temp,j;
scanf("%s,%s",str1,str2);
k1 = strlen(str1);
k2 = strlen(str2);
for(i=k1-1;i>=0;i--)
str3[k3++] = str1[i];
for(i=k2-1;i>=0;i--)
str4[k4++] = str2[i];
str3[k3] = 0;
str4[k4] = 0;
//puts(str3);
//puts(str4);
for(i=0;str3[i]&&str4[i];i++)
{
temp = (str3[i]-48)+(str4[i]-48)+c;
if(temp<10)
{
result[i] = temp+48;
c = 0;
}
else
{
result[i] = temp-10+48;
c = 1;
}
}
if(k3>k4)
{
for(j=i;str3[j];j++)
{
result[j] = str3[j]+c;
c = 0;
}
}
else
{
for(j=i;str4[j];j++)
{
result[j] = str4[j]+c;
c = 0;
}
}
result[j] = 0;
//puts(result);
c = 0;
for(i=strlen(result)-1;i>=0;i--)
{
result2[c++] = result[i];
}
result2[c] = 0;
printf("%s",result2);
return 0;
}
没仔细研究