#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string>
#include <iostream>
using namespace std;
#define MAX 100
char* add_func(char *a,char*b)
{
int num1 = strlen(a);
int num2 = strlen(b);
if (num1<num2)
{
int temp = num1;
num1 = num2;
num2 = temp;
char *p = a;
a = b;
b = p;
}
int c = 0;
int num3 = num1;
char* r=(char*)malloc(MAX + 1);
memset(r,0,strlen(r));
int i = 0;
for (i = 0; i<num1; i++)
{
if (i<num2)
{
int d = a[num1 - 1 - i] - ‘0‘ + b[num2 - 1 - i] - ‘0‘ + c;
if (d >= 10)
{
c = 1;
r[i] = char((d - 10) + ‘0‘);
}
else
{
c = 0;
r[i] = char(d + ‘0‘);
}
}
else
{
int d = a[num1 - i - 1] - ‘0‘ + c;
if (d >= 10)
{
if (i == num1 - 1)
{
num3 += 1;
r[i + 1] = ‘1‘;
}
c = 1;
r[i] = char(‘0‘ + (d - 10));
}
else
{
c = 0;
r[i] = char(‘0‘ + d);
}
}
}
r[i + 2] = ‘\0‘;
return r;
}
int main()
{
char *a = (char*)malloc(MAX);
char *b = (char*)malloc(MAX);
cin >> a >> b;
char *sum = add_func(a,b);
int i = 0;
int len = strlen(sum);
for (i = 0; i<len; i++)
{
printf("%c", sum[len - i - 1]);
}
printf("\n");
return 0;
}