1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 const int N = 1e5+5; 6 7 char a[N],b[N]; 8 9 struct bign{ 10 int d[N]; 11 int len; 12 bign(){ 13 memset(d,0,sizeof(d)); 14 len = 0; 15 } 16 }; 17 18 bign change(char *t){ 19 bign c; 20 int len = strlen(t); 21 c.len = len; 22 for(int i=0; i<len; i++){ 23 c.d[i] = t[len - i - 1] - '0'; 24 } 25 return c; 26 } 27 28 bign add(bign a, bign b){ 29 bign c; 30 int carry = 0; 31 for(int i=0; i<a.len || i<b.len; i++){ 32 int t = a.d[i] + b.d[i] + carry; 33 c.d[c.len++] = t % 10; 34 carry = t / 10; 35 } 36 if(carry != 0) c.d[c.len++] = carry; 37 return c; 38 } 39 40 void print(bign c){ 41 for(int i=c.len - 1; i>=0; i--){ 42 printf("%d",c.d[i]); 43 } 44 } 45 46 int main(){ 47 scanf("%s%s",a,b); 48 bign v1 = change(a); 49 bign v2 = change(b); 50 print(add(v1,v2)); 51 return 0; 52 }