semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
char p[1001], q[1001];
int j, k, n, m;
char *a, *b;
void cal()
{
    for (j = n, k = m; k >= 0; -- j, -- k)
        a[j] += b[k] - '0';
    for (j = n; j; -- j)//????
    {
        a[j - 1] += (a[j] - '0') / 10;
        a[j] = (a[j] - '0') % 10 + '0';
    }
    return;
}
int main()
{
    cin >> p >> q;
    if (strlen(p) < strlen(q))//?a???????
    {
        a = q;
        b = p;
    }
    else
    {
        a = p;
        b = q;
    }
    n = strlen(a) - 1;
    m = strlen(b) - 1;
    cal();
    if (a[0] > '9')//???????
    {
        cout << 1;
        a[0] -= 10;
    }
    else//????????
        while (strlen(a) != 1 && a[0] == '0')
            ++ a;
    cout << a << endl;
    return 0;
}
int main()
{   
	char a1[251],a2[251];
	int  b1[251],b2[251];
	memset(b1 ,0 ,sizeof(b1) );
	memset(b2 ,0 ,sizeof(b2) );

	gets(a1);
	gets(a2);
	int n1=strlen(a1),n2=strlen(a2);
	
	int i,j;
	j=0;
	for( i=n1-1;i>=0;i--)
		b1[j++]=a1[i]-'0';
	j=0;
	for( i=n2-1;i>=0;i--)
		b2[j++]=a2[i]-'0';

	for( i=0;(i<=n1)||(i<=n2);i++)
	{
		b1[i]+=b2[i];
		if(b1[i]>=10)
		{
				b1[i]=b1[i]%10;
				b1[i+1]++;
		}

	}

	i=250;
	while( b1[i]==0)
	{
		i--;
		if( i==0 )
			break;
	}

	while(i>=0)
		cout<<b1[i--];
	cout << endl;

	return 0;
}
int main()
{
	char s1[251] = {0};
	char s2[251] = {0};
	gets(s1);
	gets(s2);
	int l1,l2;
	int zeroPrefix = 0;
	l1=strlen(s1);
	l2=strlen(s2);

    int i;
	char *p1;
	char *p2;
	int max,min;
	char longer[251]={0};
	char shorter[251]={0};
	if(l1>=l2){
		strcpy(longer,s1);
		strcpy(shorter,s2);
		max=l1;
		min=l2;
	}else{
		strcpy(longer,s2);
		strcpy(shorter,s1);
		max=l2;
		min=l1;
	}
	p1=longer+max-1;
	p2=shorter+min-1;


	int t;
	t=0;

	if(max!=min){
	    for(i=0;i<min;i++,p1--,p2--){

				if((*p1+*p2-'0')<='9'){
					*p1=*p1+*p2-'0';
				}else{
					*p1=*p1+*p2-':';
					*(p1-1)=*(p1-1)+1;
				}

		}
		for(i=min;i<max;i++,p1--){
			if(i!=(max-1)){
			    if(*p1<='9'){
					break;

				}else{
					*(p1-1)=*(p1-1)+1;
					*p1='0';

				}
			}else{
				if(*p1<='9'){
					break;

				}else{
					t=1;
					*p1='0';


				}
			}
		}
		if(t==1){
			printf("1");
			puts(longer);
		}else{
			for(i=0;i<max;i++){
				if(longer[i]!='0' || zeroPrefix == 1){

				    zeroPrefix = 1;
					printf("%c",longer[i]);
				}
			}
			if(zeroPrefix == 0)
			printf("0");

		}
	}else{
		for(i=0;i<max;i++,p1--,p2--){
			if(i!=(max-1)){
				if((*p1+*p2-'0')<='9'){
					*p1=*p1+*p2-'0';
				}else{
					*p1=*p1+*p2-':';
					*(p1-1)=*(p1-1)+'1'-'0';
				}
			}else{
				if(*p1+*p2-'0'<='9'){
					*p1=*p1+*p2-'0';
				}else{
					t=1;
					*p1=*p1+*p2-':';

				}
			}
		}
		if(t==1){
			printf("1");
			puts(longer);
		}else{
			for(i=0;i<strlen(longer);i++){
				if(longer[i]!='0' || zeroPrefix == 1){
				    zeroPrefix = 1;
					printf("%c",longer[i]);
				}
			}
			if(zeroPrefix == 0)
			printf("0");

		}
	}


	return 0;
}
int  main()
{
  
   char a[253],b[253];
   int a1[252],b1[252],c[252];
   memset(a1,0,sizeof(a1));
   memset(b1,0,sizeof(b1));
   memset(c,0,sizeof(c));
   cin.getline(a,253);
   cin.getline(b,253);
   int length1=strlen(a),length2=strlen(b);
  if(strcmp(a,"0")==0&&strcmp(b,"0")==0)
	  cout<<'0'<<endl;
  else
{   int i,j=0;
   i=length1-1;
   for(int temp=i;temp>=0;temp--)
	   a1[j++]=a[temp]-'0';
   i=length2-1;  j=0;
   for(int temp=i;temp>=0;temp--)
	   b1[j++]=b[temp]-'0';
  /* for(i=0;i<252;i++)
	{   c[i]=a1[i]+b1[i];
      if(c[i]>=10)  
       {
	      c[i]-=10;
	      c[i+1]++;
       }
   }*/
   for(i=0;i<252;i++)
   {
     a1[i]+=b1[i];
     if(a1[i]>=10)
	 {
	   a1[i]-=10;
	   a1[i+1]++;
	 }
   }
   i=251;
   while(a1[i]==0)  i--;
   for(;i>=0;i--)
	   cout<<a1[i];
   cout<<endl;
  }

   return 0;
}
int max(int x,int y)
{
	if(x>=y)
		return x;
	else
		return y;
}
int main()
{
	char a[260];
	char b[260];
	scanf("%s",a);
	scanf("%s",b);
	
	char num[10]={'0','1','2','3','4','5','6','7','8','9'};
	int numa[260]={0};
	int numb[260]={0};
	int c[260]={0};
	
	int i,j,lena,lenb;
	lena=strlen(a);
	lenb=strlen(b);
	
	int k=0;
	for(i=lena-1;i>=0;i--)
	{
		for(j=0;j<10;j++)
		{
			if(a[i]==num[j])
			{
				numa[k]=j;      //???a(12345)?????(54321)
			}
		}
		k++;
	}
	k=0;         //???!!
	for(i=lenb-1;i>=0;i--)
	{
		for(j=0;j<10;j++)
		{
			if(b[i]==num[j])
			{
				numb[k]=j;       //???b(1234567)?????(7654321)
			}
		}
		k++;
	}
	for(i=0;i<max(lena,lenb);i++)
    {
		if(c[i]+numa[i]+numb[i]<10)
		    c[i]=numa[i]+numb[i]+c[i];     //??????,??c
		else
		{
			c[i]=numa[i]+numb[i]+c[i]-10;
			c[i+1]=c[i+1]+1;               //?10?1
		}
	}
	int M;
	for(i=max(lena,lenb);i>=0;i--)
	{
		if(c[i]!=0)
        {
			M=i;
		    break;
		}
	}
	for(i=M;i>=0;i--)
	{
		printf("%d",c[i]);
	}
	printf("\n");
	return 0;
}
int a[300],aw;
int b[300],bw;
int c[300],cw;
int main(){
	char tp[300];
	cin>>tp;
	for(int i=1;i<=strlen(tp);i++){
		a[i]=tp[strlen(tp)-i]-48;
		
	}
	aw=strlen(tp);
	cin>>tp;
	for(int i=1;i<=strlen(tp);i++){
		b[i]=tp[strlen(tp)-i]-48;
	}
	bw=strlen(tp);
	
	int max=aw>bw?aw:bw;
	c[1]=0;
	for(int i=1;i<=max;i++){
		c[i+1]=0;
		c[i]=c[i]+a[i]+b[i];
		c[i+1]=c[i]/10;
		c[i]=c[i]%10;
	}
	cw=1;
	for(int i=max+5;i>=1;i--){
		if(c[i]!=0){
			cw=i;
			break;
		}
	}
	for(int i=0;i<cw;i++){
		cout<<c[cw-i];
	}
}
int main()
{
	char cha[300],chb[300];
	int a[300],b[300];
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	cin>>cha>>chb;
	int i,j,k=0,lena,lenb;
	lena = strlen(cha);
	lenb = strlen(chb);
	for(i=lena-1;i>=0;i--)
		a[k++] = cha[i] - 48;
	k=0;
	for(i=lenb-1;i>=0;i--)
		b[k++] = chb[i] - 48;
	for(i=0;i<300;i++)
		a[i] += b[i];
	for(i=0;i<300;i++)
		if(a[i]>=10)
		{
			a[i] -= 10;
			a[i+1]++;
		}
	j=299;
	while(a[j]==0 && j>0) j--;
	for(i=j;i>=0;i--)
		cout<<a[i];
	cout<<endl;
	return 0;
}
typedef int data;
struct node;
typedef struct node* pnode;
struct node
{
  data value;
  pnode pnext;
};
void node_create(pnode *pheader,int l,char a[length],int max)
{
  pnode p=*pheader;
  p->pnext=NULL;
  for(int i=0;i<l;i++)
  {
     pnode pnew=(pnode)malloc(sizeof (struct node));
     pnew->value=a[i]-'0';
     pnew->pnext=p->pnext;
     p->pnext=pnew;
     p=*pheader;
  }
  for(int i=0;i<l;i++) p=p->pnext;
  for(int i=l-1;i<=max;i++) 
  {
     pnode pnew=(pnode)malloc(sizeof (struct node));
     pnew->value=0;
     pnew->pnext=p->pnext;
     p->pnext=pnew;
     p=p->pnext;
  }
}
void node_plus(pnode pheader1,pnode pheader2,pnode* pheader3,int max)
{
   int sum,num=0;
   pnode p1=pheader1->pnext;
   pnode p2=pheader2->pnext;
   pnode p3=(*pheader3)->pnext;
   for(int i=0;i<=max;i++)
   {
         sum=p1->value+p2->value+num;
         if(sum<10) {p3->value=sum;num=0;}
         else {p3->value=sum-10;num=1;}
         p1=p1->pnext;
         p2=p2->pnext;
         p3=p3->pnext;
   }
}
void node_delete(pnode pheader)
{
   pnode p=pheader->pnext;
   pnode ptemp;
   while(p!=NULL)
   {
      ptemp=p;
      p=p->pnext;
      free(ptemp);
   }
   pheader->pnext=NULL;
}
void output(pnode pheader3,int l)
{
  int t;
  pnode p=pheader3;
  int a[length]={0};
  for(int i=0;i<l;i++)
  {p=p->pnext;a[i]=p->value;}
  for(int i=l-1;i>=0;i--) {if(a[i]!=0) {t=i;break;}}
  for(int i=t;i>=0;i--) {printf("%d",a[i]);}
}
main()
{
   struct node header1,header2,header3;
   pnode pheader1=&header1;
   pnode pheader2=&header2;
   pnode pheader3=&header3;
   int l1,l2;
   int max;
   char a1[length]={'\0'},a2[length]={'\0'},a3[length+1]={'\0'};
   for(int i=0;i<length+1;i++) {a3[i]='0';}

   gets(a1);
   l1=strlen(a1);
   gets(a2);
   l2=strlen(a2);
   if(l1>=l2) max=l1+1;
   else max=l2+1;
   node_create(&pheader1,l1,a1,max);
   node_create(&pheader2,l2,a2,max);
   node_create(&pheader3,max,a3,max);
   node_plus(pheader1,pheader2,&pheader3,max);
   output(pheader3,max);
   node_delete(pheader1);
   node_delete(pheader2);
   node_delete(pheader3);
   getchar();
   getchar();
}
main()
{
      char str1[252],str2[252],str[252];
      int i,j,k,n,n1,n2;
      scanf("%s",str1);
      scanf("%s",str2);
      n1=strlen(str1);
      n2=strlen(str2);
      for(i=n1-1;i>=0;i--)
      str1[i+251-n1]=str1[i];
      for(i=0;i<251-n1;i++)
      str1[i]='0';
      for(i=n2-1;i>=0;i--)
      str2[i+251-n2]=str2[i];
      for(i=0;i<251-n2;i++)
      str2[i]='0';
      k=0;
      for(i=250;i>=0;i--)
      {
                         
                         str[i]=str1[i]+str2[i]-'0'-'0'+k;
                         if(str[i]>9)
                        { k=1;
                        str[i]=str[i]+'0'-10;
                        }
                         if(str[i]<=9)
                         {k=0;
                         str[i]=str[i]+'0';
                         }
                         }
                         for(i=0;i<=250;i++)
                         {
                                            if(str[i]!='0')
                                            {
                                                           n=i;
                                                           break;
                                            
                                            }
                                            }
                                            if(i==251)
                                            printf("0");
                                            for(i=n;i<=250;i++)
                                            printf("%c",str[i]);
                        
                        
                        
                        
                        
                                            
                        
                                            
                        
      }
const int maxn = 250 + 10;

int a[maxn], b[maxn], c[maxn];
int la, lb, lc;
char s[maxn], t[maxn];

int main()
{
    //freopen("8.in", "r", stdin);
    
    while (scanf("%s%s",  s, t) != EOF)
    {
          int la = strlen(s);
          int lb = strlen(t);
          memset(a, 0, sizeof(a));
          memset(b, 0, sizeof(b));
          memset(c, 0, sizeof(c));
          for (int i = 0; i < la; i ++)
              a[la - i - 1] = s[i] - '0';
          for (int i = 0; i < lb; i ++)
              b[lb - i - 1] = t[i] - '0';
          while (a[la - 1] == 0 && la > 1)
                la --;
          while (b[lb - 1] == 0 && lb > 1)
                lb --;
          if (la > lb)
             lc = la;
          else lc = lb;
          int add = 0;
          for (int i = 0; i < lc;i ++)
          {
              c[i] = (add + a[i] + b[i]) % 10;
              add = (add + a[i] + b[i]) / 10;
          }
          if (add != 0)
             c[lc ++] = add;
          for (int i = lc - 1; i >= 0; i --)
              printf("%d", c[i]);
          printf("\n");
    }
    
    //while (1);
}
main()
{
	char a[251],b[251],c[252];
	int m,n,i,t=0;
	gets(a);
	gets(b);
	m=strlen(a);
	n=strlen(b);
	if(m<n)
	{
		strcpy(c,a);
		strcpy(a,b);
		strcpy(b,c);
		i=m;
		m=n;
		n=i;
	}
	for(i=0;i<n;i++)
	{
		c[i]=(a[m-1-i]+b[n-1-i]-'0'*2+t)%10+'0';
		t=(a[m-1-i]+b[n-1-i]-'0'*2+t)/10;
	}
	for(i=n;i<m;i++)
	{
		c[i]=(a[m-1-i]-'0'+t)%10+'0';
		t=(a[m-1-i]-'0'+t)/10;
	}
	if(t)
	{
		c[i]=1+'0';
		i++;
	}
	c[i]='\0';
	m=strlen(c);
	t=n=0;
	while(m--)
	{
		t+=*(c+m)-'0';
		if(t)
		{printf("%c",*(c+m));
		n++;}
	}
	if(n==0)
		printf("0");
}
int main()
{
    char a[200],b[200];
	int m[200]={0},n[200]={0},str1,str2,c[201]={0},str;
    scanf("%s",a);
	scanf("%s",b);
	str1=strlen(a);
	str2=strlen(b);
	for(int i=0;i<str1;i++)
		m[str1-i-1]=a[i]-'0';
    for(int e=0;e<str2;e++)
		n[str2-e-1]=b[e]-'0';
	str=str1>str2?str1:str2;
	int s=0;
	for(int j=0;j<=str+1;j++)
	{
		int x;
		x=m[j]+n[j]+s;
		if(x<10)
		{
			c[j]=x;
			s=0;
		}
		else if((x>=10)&&(x<19))
		{
			c[j]=x-10;
			s=1;
		}
        else if((x>=20)&&(x<29))
		{
            c[j]=x-20;
			s=2;
		}
		if((str==1)&&(x==0))
		{
             printf("0");
             j=str+2;
        }
	}
	int q=0;
	for(int k=str;k>=0;k--)
	{
		if(q==0)
		{
			if(c[k]==0)
			q=0;
			else
			{
				q=1;
				printf("%d",c[k]);
			}	
		}
		else
			printf("%d",c[k]);
	}
	printf("\n");
}
int main()
{
 	const int MAX_LEN=200;
	unsigned an1[MAX_LEN];
	unsigned an2[MAX_LEN];
	char seLine1[MAX_LEN+1]; 
	char seLine2[MAX_LEN+1];
	cin.getline(seLine1,MAX_LEN+1);
	cin.getline(seLine2,MAX_LEN+1);
	int nLen1 = strlen(seLine1);
	int nLen2 = strlen(seLine2);
	memset(an1,0,sizeof(an1));
	memset(an2,0,sizeof(an2));
	int i,j=0;
	for(i=nLen1-1;i>=0;i--)
		an1[j++]=seLine1[i]-'0';
	j=0;
	for(i=nLen2-1;i>=0;i--)
		an2[j++]=seLine2[i]-'0';
	for(i=0;i<MAX_LEN;i++)
	{
		an1[i]+=an2[i];
		if(an1[i]>=10)
		{
			an1[i]-=10;
			an1[i+1]++;
		}
	}
	i=MAX_LEN-1;
	while(an1[i]==0) i--;
	if(i>=0)
	{
	for(;i>=0;i--)
		cout<<an1[i];
	}
	else cout<<0;
	cout<<endl;
	return 0;
}
void f(char a[],char b[],char * p)
{
     int m,n;
     m=strlen(a);
     n=strlen(b);
     if(n>m)
     {
            for(int i=0;i+m<n;i++)
            p[i]=b[i];
     }
     p[n-m]='0';
     for (int i=0;i<m;i++)
     {
         if (a[m-1-i]+b[n-1-i]-'0'-'0'<10)
         p[n-i]=a[m-1-i]+b[n-1-i]-'0';
         else
         {
             p[n-i]=a[m-1-i]+b[n-1-i]-'0'-10;
             b[n-2-i]++;
         }
     }
     if(a[0]+b[n-m]-'0'-'0'>=10)
     p[n-m]++;
     p[n+1]=0;
     if(p[n-m]=='0')
     {
                  for(int i=n-m;i<n;i++)
                  p[i]=p[i+1];
                  p[n]=0;
     }
     else if(n>m)
     {
                  for(int i=n-m;i<n;i++)
                  p[i]=p[i+1];
                  p[n]=0;
                  for(int i=0;i<n-m;i++)
                  {
                          if(p[n-m-1-i]<'9')
                          {
                                          p[n-m-1-i]++;
                                          break;
                          }
                          else
                          p[n-m-1-i]='0';
                  }
     }
     if(p[0]=='0'&&p[1]!=0)
     {
                  for(int i=0;i<n+1;i++)
                  p[n+1-i]=p[n-i];
                  p[0]='1';
     }
     
}
int main()
{
    char a[260];
    char b[260];
    char c[260];
    gets(a);
    gets(b);
    
    int m,n,i;
    m=strlen(a);
    n=strlen(b);
    while(a[0]=='0'&&a[1]!=0)
    {
                 for(int j=0;j<m;j++)
                 a[j]=a[j+1];
                 m--;
                 a[m]=0;
    }
    while(b[0]=='0'&&b[1]!=0)
    {
                 for(int j=0;j<n;j++)
                 b[j]=b[j+1];
                 n--;
                 b[n]=0;
    }
    if(m>n)
    f(b,a,c);
    else
    f(a,b,c);
    printf("%s\n",c);
}
int main()
{
	char a1[251], b1[251];
	int a2[255] = { 0 }, b2[255] = { 0 }, sum[255] = { 0 };
	int a, b, i;
	cin >> a1;
	cin >> b1;
	a = strlen(a1);
	b = strlen(b1);
	for (i = 0; i < a; i++)
	{
		a2[i] = a1[a - i - 1] - '0';
	}
	for (i = 0; i < b; i++)
	{
		b2[i] = b1[b - i - 1] - '0';
	}
	for (i = 0; i < max(a, b); i++)
	{
		sum[i] = sum[i] + a2[i] + b2[i];
		if (sum[i]>9)
		{
			sum[i] -= 10;
			sum[i + 1]++;
		}
	}
	for (i = 254; ((sum[i] == 0) && (i > 0)); i--);
	for (i = i; i >= 0; i--)
	{
		cout << sum[i];
	}
	cout << endl;
	return 0;
}
int main()
{
	char a1[260];
	char a2[260];

	char result[260];

	cin>>a1>>a2;

	int len1=strlen(a1);
	int len2=strlen(a2);


	memset(result,0,sizeof(result));
	int i=len1-1;
	int j=len2-1;
	int k=0;
	
	while(i>=0 && j>=0)
	{
		result[k]+=a1[i]+a2[j]-'0';
		if(result[k]>'9')
		{
			result[k+1]++;
			result[k]-=10;
		}
		i--;
		j--;
		k++;
	}
	if(i>=0)
	{
		while(i>=0)
		{
			result[k]+=a1[i];
			if(result[k]>'9')
			{
				result[k+1]++;
				result[k]-=10;
			}
			i--;
			k++;
		}
	}
	if(j>=0)
	{
		while(j>=0)
		{
			result[k]+=a2[j];
			if(result[k]>'9')
			{
				result[k+1]++;
				result[k]-=10;
			}
			j--;
			k++;
		}
	}

	if(result[k]!=0)
	{
		result[k]+='0';
		k++;
	}

	while(result[k-1]=='0' && k!=1)
		k--;


	char final[260];
	memset(final,0,sizeof(final));

	for(i=0;i<k;i++)
		final[i]=result[k-1-i];

	cout<<final<<endl;

	

}
int max(int a, int b)
{
    if(a > b) return a;
    else return b;
}
int main()
{
    int a[260] = {0}, b[260] = {0}, carry = 0, c[260] = {0}, i, j;
    char s1[260], s2[260];
    cin >> s1 >> s2;
    int len1 = strlen(s1);
    int len2 = strlen(s2);
    int len = max(len1, len2);
    for(i = len1 - 1, j = 0; i >= 0; --i, ++j)
    {
        a[i] = s1[j] - '0';
    }
    for(i = len2 - 1, j = 0; i >= 0; --i, ++j)
    {
        b[i] = s2[j] - '0';
    }
    for(i = 0; i < len + 1; ++i)
    {
        c[i] = a[i] + b[i] + carry;
        if(c[i] >= 10)
        {
            carry = 1;
            c[i] -= 10;
        }
        else carry = 0;
    }
    int judge = 0;
    /*for(i = len; c[i] == 0; --i);
    cout << i << endl;
    if(1) cout << 0;
    else*/
    for(;i >=0; --i)
    {
        if(c[i] != 0 || (c[i] == 0 && i == 0)) judge = 1;
        if(judge == 1) cout << c[i];
    }
    return 0;
}
int main()
{
	int d[1000]={0};
	int b[1000]={0};
	int q[1000]={0};
	int a1,c1,num;
	char c[1000];
	char a[1000];
	gets(c);
	gets(a);
	a1=strlen(a);
	c1=strlen(c);
	int i=0;
	do
	{b[i]=c[c1-1-i]-48;
	i++;}while(i<c1);
	i=0;
	do
	{d[i]=a[a1-1-i]-48;
	i++;}while(i<a1);
	i=0;num=0;
	do
	{
		q[i]=(d[i]+b[i]+num)%10;
		if(q[i]==b[i]+d[i]+num)
		{num=0;}
		else
		{num=1;}
		i++;
	}while(i<=999);
	i=999;
	do
	{
		if(q[i]!=0)
		{break;}
		i--;
	}while(i>=1);
	i=i;
	do
	{
		printf("%d",q[i]);
		i--;
	}while(i>=0);
	return 0;
}
int main()
{ int i,j,l1,l2,a1[301],a2[301],a3[301];
  char s1[253],s2[253];
  cin.getline(s1,253);
  cin.getline(s2,253);
  l1=strlen(s1);
  l2=strlen(s2);
  j=0;
  memset(a1,0,sizeof(a1));
    memset(a2,0,sizeof(a2)); 
	   memset(a3,0,sizeof(a3)); 
  for(i=l1-1;i>=0;i--)
  { a1[j++]=s1[i]-'0';}
   j=0;
  for(i=l2-1;i>=0;i--)
  { a2[j++]=s2[i]-'0';}
  for(i=0;i<299;i++)
  {   a3[i]+=a1[i]+a2[i];
  if(a3[i]>=10)
  { a3[i+1]++;
	a3[i]-=10;}
  }
  i=299;
  while(a3[i]==0&&i>0)i--;
  for(;i>=0;i--)
  {cout<<a3[i];}
  

return 0;}
int main()
{
	char	num1[300], num2[300];
	int	l1, l2;
	int	i, j, k;
	int	sum[300] = {0};		
	while(1)
	{
		cin.getline(num1,300);
		cin.getline(num2,300); 
		l1 = strlen(num1);
		l2 = strlen(num2);
		
		if(num1[0] == '\0'){break;}
		if(l1 < l2)
		{
			char	huan[300];		
			strcpy(huan, num1);
			strcpy(num1, num2);
			strcpy(num2, huan);
			int	k;
			k = l1, l1 = l2, l2 = k;
		}
		
		//??
		for (i = l1 - 1; i >= 0; i --)
		{
			num1[i + 1] = num1[i];
		}
		for (i = l2 - 1; i >= 0; i --)
		{
			num2[i + l1 - l2 + 1] = num2[i];
		}


		num1[0] = '0';
		for (i = 0; i <= l1 - l2; i ++)
		{num2[i] = '0';}//?????0 
		
		//??? (?????????????)
		for (i = l1; i >= 0; i --)
		{
			int	n1, n2;
			n1 = (int)(num1[i] - '0');
			n2 = (int)(num2[i] - '0');
			sum[i] = n1 + n2;
		}//?sum 
		for (i = l1; i >= 0; i --)
		{
			if(sum[i] > 9)
			{
				sum[i - 1] ++;
				sum[i] = sum[i] - 10;
			}
		}//?? 
				
		
		//??
		for (i = 0; i <= l1; i ++)
		{
			if(sum[i] == 0)
			{continue;}
			else
			{break;}
		}//????0??? (?????????????????)
		
		if(i == l1 + 1)
		{
			cout << "0" << endl; 
		}
		else
		{
			for (j = i; j <= l1; j ++)
			{
				cout << sum[j];
			}
			cout << endl; 
		}

	}
return 0;
}
//****************************
//????????
//???2013.12.21
//****************************
int main()
{
	char a[260],b[260];
	int i=0,j=0,n[260]={0},m[260]={0},l=0;
	gets(a);
	gets(b);
	for(i=strlen(a)-1;i>=0;i--)
		n[j++]=a[i]-'0';
	j=0;
	for(i=strlen(b)-1;i>=0;i--)
		m[j++]=b[i]-'0';
	if(strlen(a)>strlen(b))
		l=strlen(a);
	else
		l=strlen(b);
	for(i=0;i<l;i++)
	{
		n[i]=n[i]+m[i];
		if(n[i]>=10)
		{   
			n[i+1]=n[i+1]+1;
			n[i]=n[i]-10;
		}
	}
	while(n[l]==0)
		l--;
	if(l>0)
	for(i=l;i>=0;i--)
		cout<<n[i];
	else
		cout<<"0";
	cout<<endl;
	return 0;
}
int str2bigint(char*str,int*a){
	int len=strlen(str);
	int i;
	for(i=0;i<len;i++){
		a[len-i-1]=str[i]-'0';
	}
	return len;
}
void print_bigint(int*a,int len){
	int k=len-1;
	int i;
	while(a[k]==0&&k>0){
		k--;
	}
	for(i=k;i>=0;i--){
		printf("%d",a[i]);
	}
}
int add_bigint(int*a, int alen,int*b,int blen,int*c){
	int i;
	int len=(alen>blen)?alen:blen;
	for(i=0;i<len;i++){
		c[i]=0;
		if(i<alen){
			c[i]=c[i]+a[i];
		}
		if(i<blen){
			c[i]+=b[i];
		}
	}
	c[len]=0;
	for(i=0;i<len;i++){
		if(c[i]>=10){
			c[i+1]+=c[i]/10;
			c[i]%=10;
		}
	}
	return c[len]?(len+1):len;
}

int main(){
	char s1[MAX],s2[MAX];
	int a[MAX],b[MAX],c[MAX];
	int alen,blen,clen;
	scanf("%s%s",s1,s2);
	alen=str2bigint(s1,a);
	blen=str2bigint(s2,b);
	clen=add_bigint(a,alen,b,blen,c);
	print_bigint(c,clen);
	return 0;
}
int main()
{
    char str1[252],str2[252],str3[253];
    char c;
    int s,i,a,b;
    gets(str1);
    gets(str2);
    a=strlen(str1);
    b=strlen(str2);
    for(i=0;i<=a/2-1;i++)
    {
       c=str1[i];
       str1[i]=str1[a-1-i];
       str1[a-1-i]=c;
    }
    for(i=0;i<=b/2-1;i++)
    {
       c=str2[i];
       str2[i]=str2[b-1-i];
       str2[b-1-i]=c;
    }
    if(a>b)
    {
       for(i=b;i<a;i++)
       str2[i]='0';
       str2[i]='\0';
    }
    if(a<b)
    {
       for(i=a;i<b;i++)
       str1[i]='0';
       str1[i]='\0';
    }
    for(i=0;str1[i]!='\0';i++)
    {
       s=str1[i]-'0'+str2[i]-'0';
       if(s>=10)
       {
          str3[i]=s-10+'0';
          str2[i+1]=str2[i+1]+1;
       }
       else
          str3[i]=s+'0';
    }
    if(str2[i]==1)
    {
       str3[i]='1';
       str3[i+1]='\0';
    }
    else  str3[i]='\0';
    for(i=strlen(str3)-1;str3[i]=='0'&&i>0;i--)
       str3[i]='\0';
    for(i=strlen(str3)-1;i>=0;i--)
       printf("%c",str3[i]);
}
int main()
{
	int yu=0,yu0=0,he=0,i,n,sum;
	char str1[260],str2[260],str0[260],stra[260],strb[260],res[260];

	scanf("%s%s",str1,str2);

	if (strlen(str1)==strlen(str2))
	{
		strcpy(stra,str1);
		strcpy(strb,str2);
		goto final;
	}
	if (strlen(str1)>strlen(str2))
	{
		strcpy(stra,str1);
		strcpy(str0,str2);
	}
	else 
	{
		strcpy(stra,str2);
		strcpy(str0,str1);
	}                           //???stra??????str0?????strb??0???str0???final??


	n=strlen(stra)-strlen(str0);
	for (i=0;i<=n-1;i++)
		strb[i]='0';
	strb[n]='\0';
	strcat (strb,str0);        //???stra?strb?????????

final:

	i=strlen(stra)-1;
	for (i=i;i>=0;i--)
	{
		he=stra[i]+strb[i]-'0'-'0'+yu;
		yu0=he/10;
		if (he/10!=0)
			he=he%10;
		res[i+1]=he+'0';
		yu=yu0;
	}
	res[strlen(stra)+1]='\0';
	res[0]=yu+48;                     //res?????????0
	
	for (i=0;i<=strlen(stra);i++)
	{
		sum=i;
		if (res[i]!='0')
			break;
	}
	for (i=sum;i<=strlen(stra);i++)
		printf("%c",res[i]);
	
	return 0;
}
void add(char str1[],char str2[])
{
	int a1[260],a2[260],sum[260]={0};
	int i,j,la,lb;
	la=strlen(str1);
	lb=strlen(str2);
	memset(a1,0,sizeof(a1));
	memset(a2,0,sizeof(a2));
	i=la-1;j=0;
	while(i>=0)
		a1[j++]=str1[i--]-'0';
	i=lb-1;j=0;
	while(i>=0)
		a2[j++]=str2[i--]-'0';
	for(i=0;i<la&&i<lb;i++)
	{
		sum[i]+=a1[i]+a2[i];
		if(sum[i]>=10)
		{
			sum[i]=sum[i]-10;
			sum[i+1]+=1;
		}
	}
	if(i==la)
	{
		for(i=la;i<lb;i++)
		{
			sum[i]+=a2[i];
			if(sum[i]>=10)
			{
				sum[i]-=10;
				sum[i+1]+=1;
			}
		}
	}
	else
	{
		for(i=lb;i<la;i++)
		{
			sum[i]+=a1[i];
			if(sum[i]>=10)
			{
				sum[i]-=10;
				sum[i+1]+=1;
			}
		}
	}
	i=259;
	while(sum[i]==0) 
		i--;
	if(i==-1) cout<<0<<endl;
	else
	{
		for(;i>=0;i--)
		{
			cout<<sum[i];
		}
	}
}
int main()
{
	char str1[260],str2[260];
	cin.getline(str1,260);
	cin.getline(str2,260);
	add(str1,str2);
	return 0;
}
int main(){
	int i,j,len1,len2;
	char ds1[260],ds2[260];
	int a1[260]={0};
	int a2[260]={0};
	scanf("%s%s",ds1,ds2);
	len1=strlen(ds1);
	j=0;
	for(i=len1-1;i>=0;i--){
		a1[j]=ds1[i]-'0';
		j++;
	}
	len2=strlen(ds2);
	j=0;
	for(i=len2-1;i>=0;i--){
		a2[j]=ds2[i]-'0';
		j++;
	}
	if(a1[0]==0&&a2[0]==0){
		printf("0");
		return 0;
	}
	for(i=0;i<250;i++){
		a1[i]+=a2[i];
		if(a1[i]>=10){
			a1[i]-=10;
			a1[i+1]++;
		}
	}
	int q0=0;
	for(i=250;i>=0;i--){
		if(q0)
			printf("%d",a1[i]);
		else if(a1[i]){
			printf("%d",a1[i]);
			q0=1;
		}
	}
	return 0;
}
int main() {
	int a0[251], b0[251];
	char a[251], b[251];
	cin.getline( a, 251 );
	cin.getline( b, 251 );
	memset( a0, 0, sizeof( a0 ) );
	memset( b0, 0, sizeof( b0 ) );
	for ( int i = 0; i <= strlen( a ) - 1; i ++ ) {
		a0[i] = a[strlen( a ) - 1 - i] - '0';
	}
	for ( int i = 0; i <= strlen( b) - 1; i ++ ) {
		b0[i] = b[strlen( b ) - 1 - i] - '0';
	}
	for ( int i = 0; i <= 249; i ++ ) {
		a0[i + 1] += ( a0[i] + b0[i] ) / 10;
		a0[i] = ( a0[i] + b0[i] ) % 10;
	}
	int j = 0;
	for ( int i = 249; i >= 0; i -- ) {
		if ( a0[i] != 0 ) {
			j = i;
			break;
		}
	}
	for ( int i = j; i >= 0; i -- ) {
		cout << a0[i];
	}
	cout << endl;
	return 0;
}