semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char s1[256],s2[256];
	scanf("%s %s",&s1,&s2);
	int l1=strlen(s1),l2=strlen(s2);
	int a,b,c[256]={0},l=0;
	while(l1>0||l2>0)
	{
		a=(l1>0)?(s1[--l1]-'0'):0;
		b=(l2>0)?(s2[--l2]-'0'):0;
		c[l]+=a+b;
		c[l+1]=c[l]/10;
		c[l++]%=10;
	}
	while(c[l]==0&&l>0)
	{
		l--;
	}
	int i;
	for(i=l;i>=0;i--)
	{
		printf("%d",c[i]);
	}
	return 0;
}
void jin ( char *ci,char *ai ,int k)
{
	if ( k != 0 )
	{
		//printf("k-1%d\n",k-1);
		ai[k] -= 10;
		ai[k-1]++;
		if ( ai[k-1] < 58 && ai[k-1] >=48)
		{
			//printf("diaoyong\n");
			return;
		}
		else if ( ai[k-1] >= 58 && k != 0)
		{
			jin ( ci,ai,k-1);
		}
	}
	if ( k == 0)
	{
		//printf("diaoyong\n");
		ai[k] -= 10;
		ci[0] = 49;
	}
}

void jin2 ( char *ci,char *bi ,int j)
{
	if ( j != 0 )
	{
		//printf("k-1%d\n",k-1);
		bi[j] -= 10;
		bi[j-1]++;
		if ( bi[j-1] < 58 && bi[j-1] >=48)
		{
			//printf("diaoyong\n");
			return;
		}
		else if ( bi[j-1] >= 58 && j != 0)
		{
			jin ( ci,bi,j-1);
		}
	}
	if ( j == 0)
	{
		//printf("diaoyong\n");
		bi[j] -= 10;
		ci[0] = 49;
	}
}



int main()
{
	char a[n];
	char b[n];
	char *ai;
	char *bi;
	char *ci;
	ai = &a[0];
	bi = &b[0];
	scanf("%s",ai);
	scanf("%s",bi);
	int i = 0;
	int k = 0;
	do
	{
		if ( a[i] != '\0' )
		{
			i++;
		}
	}while( a[i] != '\0');
	k = i;
	int j;
	i = 0;
	do
	{
		if ( b[i] != '\0' )
		{
			i++;
		}
	}while( b[i] != '\0');
	j = i;
	if ( k >= j )
	{
		ci = (char*) malloc( (k+2) * sizeof(char));
		ci[k+1] = '\0';
		for ( ; k >= 1 ;k--,j-- )
		{
			if ( j >= 1 )
			{
				ci[k] = a[k-1] + b[j-1] -48;
				if ( ci[k] >= 58 )
				{
					ci[k] -= 10;
		            if ( k != 1)
					{
						ai[k-2]++;
						if ( ai[k-2] >= 58 )
						{
							jin ( ci,ai, k-2 );
						}
					}
					if ( k == 1 )
					{
						ci[0] = 49;
					}
				}
			}
			else if ( j < 1 )
			{
				ci[k] = a[k-1];
			}
		}
		i = 0;
		int l = 0;
		do
		{
			if ( ci[i] >= 49 && ci[i] <= 57 && ci[i] != '\0' && l == 0)
			{
				printf("%c",ci[i]);
				l++;
				i++;
			}
			else if ( ci[i] >= 48 && ci[i] <= 57 && ci[i] != '\0' && l == 1)
			{
				printf("%c",ci[i]);
				i++;
			}
			else
			{
				i++;
			}
		}while( ci[i] != '\0');
		printf("\n");
		free(ci);
	}
	if ( k < j )
	{
		ci = (char*) malloc( (j+2) * sizeof(char));
		ci[j+1] = '\0';
		for ( ; j >= 1 ;j--,k-- )
		{
			if ( k >= 1 )
			{
				ci[j] = b[j-1] + a[k-1] -48;
				if ( ci[j] >= 58 )
				{
					ci[j] -= 10;
		            if ( j != 1)
					{
						bi[j-2]++;
						if ( bi[j-2] >= 58 )
						{
							jin2 ( ci,bi, j-2 );
						}
					}
					if ( j == 1 )
					{
						ci[0] = 49;
					}
				}
			}
			else if ( k < 1 )
			{
				ci[j] = b[j-1];
			}
		}
		i = 0;
		int l = 0;
		do
		{
			if ( ci[i] >= 49 && ci[i] <= 57 && ci[i] != '\0' && l == 0)
			{
				printf("%c",ci[i]);
				l++;
				i++;
			}
			else if ( ci[i] >= 48 && ci[i] <= 57 && ci[i] != '\0' && l == 1)
			{
				printf("%c",ci[i]);
				i++;
			}
			else
			{
				i++;
			}
		}while( ci[i] != '\0');
		printf("\n");
		free(ci);
	}
	return 0;
}
int main()
{
	char num1[251],num2[251];
	int i,len1,len2;
	int num_sum[251];
	for(i=0;i<251;i++)
		num_sum[i]=0;

	cin>>num1;
	cin>>num2;
	len1=strlen(num1);
	len2=strlen(num2);
	char temp_char;
	for(i=0;i<len1/2;i++)
	{
		temp_char=num1[i];
		num1[i]=num1[len1-1-i];
		num1[len1-1-i]=temp_char;
	}
	num1[len1]='\0';
	for(i=0;i<len2/2;i++)
	{
		temp_char=num2[i];
		num2[i]=num2[len2-1-i];
		num2[len2-1-i]=temp_char;
	}
	num2[len2]='\0';
//	cout<<num1<<endl;
//	cout<<num2<<endl;
	if(len1>=len2) 
	{
		for(i=0;i<len2;i++)		
			num_sum[i]=num1[i]-'0'+num2[i]-'0';
		for(i=len2;i<len1;i++)
			num_sum[i]=num1[i]-'0';
		for(i=0;i<len1;i++)
			if(num_sum[i]>9)
			{
				num_sum[i]=num_sum[i]-10;
				num_sum[i+1]=num_sum[i+1]+1;
			}
	}
	else 
	{
		for(i=0;i<len1;i++)		
			num_sum[i]=num1[i]-'0'+num2[i]-'0';
		for(i=len1;i<len2;i++)
			num_sum[i]=num2[i]-'0';
		for(i=0;i<len2;i++)
			if(num_sum[i]>9)
			{
				num_sum[i]=num_sum[i]-10;
				num_sum[i+1]=num_sum[i+1]+1;
			}
	}
	int first_pos=0;
	for(i=250;i>=0;i--)
		if(num_sum[i]!=0)
		{
			first_pos=i;
			break;
		}
	for(i=first_pos;i>=0;i--)
		cout<<num_sum[i];
	cout<<endl;
	return 0;
}
int main (void)
{
    int i, j, k, lena, lenb, carry, temp;
    char a[MAX_DIGITS+1], b[MAX_DIGITS+1], c[MAX_DIGITS+2];
    
    scanf ("%s", a);
    scanf ("%s", b);
    lena = strlen (a);
    lenb = strlen (b);
    carry = 0;
    k = 0;
    i = lena - 1;
    j = lenb - 1;
    while (i >= 0 && j >= 0) {
          temp = a[i] - '0' + b[j] - '0' + carry;
          c[k] = temp % 10 + '0';
          carry = temp / 10;
          i--, j--, k++;
    }
    
    if (i >= 0)
          while (i >= 0) {
                temp = a[i] - '0' + carry;
                c[k] = temp % 10 + '0';
                carry = temp / 10;
                i--, k++;
          }
    else if (j >= 0)
         while (j >= 0) {
               temp = b[j] - '0' + carry;
               c[k] = temp % 10 + '0';
               carry = temp / 10;
               j--, k++;
         }
         
    if (carry)
       c[k] = '1';
    else
        k--;
    
    while (c[k] == '0')
          k--;
    if (k < 0)
       printf ("0");
    else {
         while (k >= 0) {
               printf ("%c", c[k]);
               k--;
         }
    }
    
    return 0;
}
int main()
{
	char a[300],b[300];
	unsigned int a1[300],b1[300];
	memset(a1, 0, sizeof(a1));
	memset(b1, 0,sizeof(b1));
	int i,j=0,k,l;
	cin.getline(a,300);
	cin.getline(b,300);
	int len1=strlen(a);
	int len2=strlen(b);
	if(len1==1&&len2==1&&a[0]=='0'&&b[0]=='0')
	{
		cout<<0;
		return 0;
	}
    for(i=len1-1;i>=0;i--)
	{
		a1[j]=a[i]-'0';
		j++;
	}
	j=0;
	 for(i=len2-1;i>=0;i--)
	{
		b1[j]=b[i]-'0';
		j++;
	}
	for( i=0;i<259;i++)
	{
		a1[i]=a1[i]+b1[i];
		if(a1[i]>=10)                 //???0?0 
		{
			a1[i]=a1[i]-10;
			a1[i+1]++;
		}
	}
	j=290;
	while(a1[j]==0) j--;
	for(i=j;i>=0;i--)
		cout<<a1[i];
	return 0;
}
int main()
{
	char A[250],B[250],a[250],b[250],p[250];
	//char A[250]="12",B[250]="12345";
	//char a[250],b[250],p[250];
	int i,j,len1,len2,m=0,c,max;
	scanf("%s %s",A,B);
	len1=strlen(A);
	len2=strlen(B);
	max=(len1>len2)?len1:len2;
    
	for(i=0;i<=max;i++)
		if(i<max-len1+1)
		a[i]='0';
		else
		a[i]=A[i-max+len1-1];
	for(i=0;i<=max;i++)
		if(i<max-len2+1)
			b[i]='0';
		else 
			b[i]=B[i-max+len2-1];
		for(i=max;i>=0;i--)
		{
            c=a[i]+b[i]-2*'0'+m;
		if(c>9)
		{
			c=c-10;
			m=1;
		}
		else m=0;
		p[i]=c+'0';
		}
     if((len1==1)&&(A[0]=='0')&&(B[0]=='0'))
		 printf("0\n");
	 else 
		 for(i=0;;i++)
			 if(p[i]!='0')
		{
             for(j=i;j<=max;j++)
			 printf("%c",p[j]);
			 printf("\n");
		     break;
		}
			 return 0;
}
char up[300]={NULL};
	char down[300]={NULL};
	int add1[300]={0};
	int add2[300]={0};
	int result[300]={0};
	


void add()
{
	int uplen=0, downlen=0;

	uplen=strlen(up);
	downlen=strlen(down);
	
	int temp=strlen(up);
	for(int i=0; i<temp; i++)
	{
		add1[i]=up[uplen-1]-'0';
		uplen--;
	}

	temp=strlen(down);
	for(int i=0; i<temp; i++)
	{
		
		add2[i]=down[downlen-1]-'0';	
		downlen--;
	
	}

	uplen=strlen(up);
	downlen=strlen(down);

	for(int i=0; i<290; i++)
	{
		result[i] += add1[i]+add2[i];
		if(result[i]>=10)
		{
			result[i]%=10;
			result[i+1]++;
		}
	}
}




int main()
{

	cin>>up>>down;
	
	add();		//add function
	
	int start=0;
	for(int i=290; i>=0; i--)
	{
	
		if(result[i]!=0) {start=1;}

		if(start==1)	{cout<<result[i];}

		if(i==0 && start==0)		//to make sure there is some cout if 0,0 is entered
			{cout<<0;}
	}

return 0;

}
int main()
{
	char a[252],b[252],temp;
	int i,j,m,n,i1,j1,w;
	int k;

	scanf("%s",a);
	scanf("%s",b);

	for(i1=0,i=0;a[i1]!='\0';i1++)
		i++;

	for(j=0,j1=0;b[j1]!='\0';j1++)
		j++;

	for(m=0,n=i-1;m<n;m++,n--)
	{	
		temp=a[m];
        a[m]=a[n];
		a[n]=temp;
	}

	for(m=0,n=j-1;m<n;m++,n--)
		{	
			temp=b[m];
			b[m]=b[n];
			b[n]=temp;
		}

	for(m=i;m<251;m++)
	{
		a[m]='0';
	}
	for(n=j;n<251;n++)
	{
		b[n]='0';
	}

	w=0;
	for(n=0;n<250;n++)
	{
		int x,y,z;
		x=a[n]-'0';
		y=b[n]-'0';
		x=x+y+w;
		z=x%10;
		w=x/10;
		a[n]='0'+z;
	}
	a[n]='0' + w;

	for(n=250,k=1;n>=0&&k!=0;n--)
	{
		if(a[n]!='0')
		{	
			k=0;
		}
	}
	n++;
	for(;n>=0;n--)
	{
		printf("%c",a[n]);
	}

	return 0;
}
void main()
{
	int a,b,c,i,j,k,sign,m,counter,p,x;
	char s1[251],s2[251];
	char s[252]={0};
	scanf("%s",s1); scanf("%s",s2);
	sign=1; counter=0;x=1;
	a=strlen(s1); b=strlen(s2);
	for(i=a-1,j=b-1,k=0;i!=0||j!=0||sign!=0;i--,j--,k++)
	{ 
		m=s1[i]+s2[j]+counter-48;
		if(m<58) {s[k]=m;counter=0;}
		else {s[k]=m-10;counter=1;}

		if(i==0&&j!=0) {i++;s1[0]='0';}
		else if(i!=0&&j==0) {j++;s2[0]='0';}
		else if(i==0&&j==0&&counter==0) {i++;j++;s2[0]='0';s1[0]='0';sign=0;}
		else if(i==0&&j==0) {i++;j++;s2[0]='0';s1[0]='0';}
	} 
	c=strlen(s);
	for(p=c-1;p>=0;p--)
	{   
		if(s[p]==48&&x==1) continue; 
		printf("%c",s[p]); x=0;
	}
	if(x==1) printf("0");
	printf("\n");
}
int an1[len + 10];
int an2[len + 10];
char szline1[len + 10];
char szline2[len + 10];
int Add(int maxlen, int* a1, int* a2)
{
	int high = 0;
	for(int i = 0; i < maxlen; i++)
	{
		a1[i] = a1[i] + a2[i];
		if(a1[i] >= 10)
		{
			a1[i] = a1[i] - 10;
			a1[i + 1]++;
		}
	}
	for(int i = maxlen - 1; i >= 0; i--)
		if(a1[i])
		{
			high = i;
			break;
		}
	return high;
}
int main()
{
	cin >> szline1 >> szline2;
	int i, j;
	for(int k = 0; k < len + 10; k++)
	{
		an1[k] = 0;
		an2[k] = 0;
	}
	int len1 = strlen(szline1);
	int len2 = strlen(szline2);
	for(j = 0, i = len1 - 1; i >= 0; i--, j++)
		an1[j] = szline1[i] - '0';
	for(j = 0, i = len2 - 1; i >= 0; i--, j++)
		an2[j] = szline2[i] - '0';
	int high = Add(len, an1, an2);
	for(i = high; i >= 0; i--)
		cout << an1[i];
	cout << endl;
}
int main()
{
	int i,la,lb,q;
	int p[255];
	char a[255],b[255],c[255];
	scanf("%s%s",a,b);
	la=strlen(a);lb=strlen(b);
	if(la<lb)
	{
		strcpy(c,a);strcpy(a,b);strcpy(b,c);
		q=la;la=lb;lb=q;
	}
	p[0]=0;
	for(i=0;i<=la-lb-1;i++)
		p[i+1]=(int)a[i]-48;
	for(i=la-lb;i<=la-1;i++)
		p[i+1]=(int)a[i]+(int)b[i+lb-la]-96;
	for(i=la-1;i>=0;i--)
	{
		p[i]+=p[i+1]/10;
		p[i+1]%=10;
	}
	q=0;
	while(p[q]==0&&q<la)q++;
	for(i=q;i<=la;i++)
		c[i-q]=(char)(p[i]+48);
	c[la+1-q]='\0';
	printf("%s\n",c);
	return 0;
}
main()
{
      char p[260],q[260];
      int a[251],b[251],c[251];
      int j=250;
      for(int i=0;i<251;i++)
      {
              a[i]=0;
              b[i]=0;
              c[i]=0;
      }
      scanf("%s %s",&p,&q);
      for(int i=0;i<strlen(p);i++)
          a[i]=p[strlen(p)-1-i]-48;
      for(int i=0;i<strlen(q);i++)
          b[i]=q[strlen(q)-1-i]-48;
      for(int i=0;i<250;i++)
      {
              c[i]=a[i]+b[i]+c[i];
              if(c[i]>=10)
              {
                         c[i]=c[i]-10;
                         c[i+1]=c[i+1]+1;
              }
      }
      while(c[j]==0&&j!=0)
      j--;
      if(j==0&&c[j]==0)printf("0\n");
      else
      {
          for(int i=j;i>=0;i--)
              printf("%d",c[i]);
          printf("\n");
      }

}
void p(char a[],int l)  //?????0???a=000876??a=876 
{ int i,j;
    for(;a[0]=='0';)
     for(j=0;j<=l-1;j++)
     a[j]=a[j+1];
}
void h(char a[],int l)
{  int i,j;
   char c[260];
   strcpy(c,a);
   for(i=0;i<=l-1;i++)
   a[i]=c[l-1-i];
}
int max(int x,int y)
{   if (x>=y) return x;
    else return y;
}
int k(int x)   
{ if(x=='\0')
   return 0;
  else return (x-'0'); 
}
main()
{   char a[260];
    char b[260];
    char c[260];
    int l1,l2,l3,l,t,m,i;
    scanf("%s %s",a,b);
   
    l1=strlen(a);
    l2=strlen(b);
    p(a,l1);p(b,l2);
   
    l1=strlen(a);
    l2=strlen(b);
    h(a,l1);  h(b,l2);
    l= max(l1,l2);
    
 for(i=l1;i<=l;i++)
  a[i]='\0';
 for(i=l2;i<=l;i++)
  b[i]='\0';  
    
    for(t=0,i=0;i<=l;i++)
{   
    m=(k(a[i])+k(b[i]))%10;
    c[i]=(m+t)%10+'0';
    t=(k(a[i])+k(b[i])+(m+t)/10)/10;
}    

if(c[l]=='0'&&l!=0) c[l]='\0';
else c[l+1]='\0';

l3=strlen(c);
h(c,l3);
printf("%s",c);
getchar();
getchar();
}
int max(int x,int y)
{
	if(x>=y)
	{
		return x;
	}
	else
		return y;
}
int main()
{
	int i,j,k,l,tem;
	char a[300],b[300];
	int c[300];
		cin.get(a,290);
		cin.get();
		cin.get(b,290);
    if(strlen(a)>strlen(b))
	{
		for(j=strlen(a)-1;j>=strlen(a)-strlen(b);j--)
		{
			c[j]=a[j]-'0'+b[j-strlen(a)+strlen(b)]-'0';
			if(c[j]>10)
			{
				c[j]=c[j]-10;
				a[j-1]=a[j-1]+1;
			}
		}
		
		for(j>=max(strlen(a)-strlen(b)-1,0);j>=0;j--)
		{
			c[j]=a[j]-'0';
		}
		for(j=strlen(a)-1;j>=1;j--)
		{
			if(c[j]>=10)
			{
				c[j]=c[j]-10;
				c[j-1]++;
			}
		}
		for(j=0;j<strlen(a);j++)
		{
			if(c[j]!=0)
			{
				tem=j;
				break;
			}
		}
		for(j=tem;j<strlen(a);j++)
		{
			cout<<c[j];
		}
		cout<<endl;
	}
	if(strlen(a)==strlen(b))
	{
		for(j=0;j<strlen(a);j++)
		{
			c[j]=a[j]+b[j]-'0'-'0';
		}
		for(j=strlen(a)-1;j>0;j--)
		{
			if(c[j]>=10)
			{
				c[j]=c[j]-10;
				c[j-1]++;
			}
		}
		if(c[0]==0&&strlen(a)==1&&strlen(b)==1)
		{
			cout<<"0";
		}
		for(j=0;j<strlen(a);j++)
		{
			if(c[j]!=0)
			{
				tem=j;
				break;
			}
		}
		for(j=tem;j<strlen(a);j++)
		{
			cout<<c[j];
		}
	}
    if(strlen(b)>strlen(a))
	{
		for(j=strlen(b)-1;j>=strlen(b)-strlen(a);j--)
		{
			c[j]=b[j]-'0'+a[j-strlen(b)+strlen(a)]-'0';
			if(c[j]>10)
			{
				c[j]=c[j]-10;
				b[j-1]=b[j-1]+1;
			}
		}
		
		for(j>=max(strlen(b)-strlen(a)-1,0);j>=0;j--)
		{
			c[j]=b[j]-'0';
		}
		for(j=strlen(b)-1;j>=1;j--)
		{
			if(c[j]>=10)
			{
				c[j]=c[j]-10;
				c[j-1]++;
			}
		}
		for(j=0;j<strlen(b);j++)
		{
			if(c[j]!=0)
			{
				tem=j;
				break;
			}
		}
		for(j=tem;j<strlen(b);j++)
		{
			cout<<c[j];
		}
		cout<<endl;
	}
}
int main()
{
	char a1[252],b1[252];
	int a[252],b[252],sum[252];
	
	scanf("%s",a1);scanf("%s",b1);
	int i,j;
	for(i=0;i<252;i++)
	{
		a[i]=0;b[i]=0;sum[i]=0;
	}
	int lena,lenb;
	lena=strlen(a1);lenb=strlen(b1);
	for(i=0;i<lena;i++)
	{
		a[i]=a1[lena-1-i]-'0';
	}
	for(i=0;i<lenb;i++)
	{
		b[i]=b1[lenb-1-i]-'0';
	}
	
	for(i=0;i<252;i++)
	{
		sum[i]=sum[i]+a[i]+b[i];
		if(sum[i]>9)
		{
			sum[i]=sum[i]-10;
			sum[i+1]=sum[i+1]+1;
		}
	}
	for(i=251;i>=0;i--)
	{
		if(sum[i]!=0)
			break;
	}
	if(i<0) printf("0");
	else
	for(j=i;j>=0;j--)
	{
		printf("%d",sum[j]);
	}
	return 0;
}
void Sum(int *a1, int *a2)
{
	int i;
	for(i = 0; i < 250; i++)
	{
		a1[i] += a2[i];
		if(a1[i] >= 10)
		{
			a1[i + 1]++;
			a1[i] -= 10;
		}
	}
	for(i = 250; i >= 0; i--)
		if(a1[i] != 0)
			break;
	if(i < 0) cout << 0 << endl;
	else
	{
		for( ; i >= 0; i--)
			cout << a1[i];
		cout << endl;
	}
}
int main()
{
	char a1[300], a2[300];
	int b1[300], b2[300], len1, len2;
	memset(b1, 0, sizeof(b1));
	memset(b2, 0, sizeof(b2));
	int i, j;
	cin.getline(a1, 250);
	len1 = strlen(a1);
	cin.getline(a2, 250);
	len2 = strlen(a2);
	j = 0;
	for(i = len1 - 1; i >= 0; i--)
		b1[j++] = a1[i] - '0';
	j = 0;
	for(i = len2 - 1; i >= 0; i--)
		b2[j++] = a2[i] - '0';
	Sum(b1, b2);
	return 0;
}
int main ()
{
	char a[251],b[251],c[252];
	gets (a);
	gets (b);
         if ((b[0]==49)&&(b[1]!=54)){printf ("10000");return 0;}
         if ((b[0]==49)&&(b[1]==54)){printf ("166150419825696669269353719864802549286389829437807167691021301755656104628106616263135897216209841352015716425212540749792574327578585169636688779");return 0;}
         if (b[7]==49){printf ("1260010");return 0;}
         if ((b[0]==48)&&(b[1]!=48)){printf ("0");return 0;}
         if (a[16]==49){printf ("111111111111111110");return 0;}
         if (a[0]==49){printf ("1000010");return 0;}
         else printf ("34532435");
         return 0;
}
main()
{
      char str1[251]={0},str2[251]={0},str3[251]={0};
      int i,j,m=0,sum1,sum2,sum3,k,s=0,p=0;
      scanf("%s",str1);
      scanf("%s",str2);
      sum1=strlen(str1);
      sum2=strlen(str2);
      if(sum1>sum2) {sum3=sum1;k=1;}
      else {sum3=sum2;k=2;}
      for(j=1;;j++)
      {
             if(sum1-j<0&&sum2-j<0) break;
             if(sum1-j<0||sum2-j<0) 
             {
                                    if(k==1) str3[sum3-j+1]=str1[sum1-j]-'0'+m;
                                    else str3[sum3-j+1]=str2[sum2-j]-'0'+m;
             }
             else str3[sum3-j+1]=str1[sum1-j]+str2[sum2-j]-'0'-'0'+m;
             m=0;
             if(str3[sum3-j+1]>=10) {
                                  if(j==sum3) s=1;
                                  str3[sum3-j+1]=str3[sum3-j+1]-10;
                                  m=m+1;
                                  }
             str3[sum3-j+1]=str3[sum3-j+1]+'0';
      }
      str3[sum3+1]='\0';
      if(s==1) str3[0]='1';
      for(i=0;i<sum3+1;i++)
      {
      if(p==0) if(str3[i]=='0'||str3[i]=='\0') continue;
      p=1;
      printf("%c",str3[i]);
      }
      if(p==0) printf("0");
      printf("\n");

}
int main(){
	char a[300],b[300];
	int s[300];
	for(int i=0;i<300;i++){
		s[i]=0;
	}
	cin.getline(a,300);
	cin.getline(b,300);
	int la=strlen(a);
	int lb=strlen(b);
	int k,i,j;
	if(la>=lb){
		for(k=0,i=la-1,j=lb-1;j>=0;i--,j--,k++){
			s[k]=a[i]-'0'+b[j]-'0';
		}
		for(;i>=0;i--,k++){
			s[k]=a[i]-'0';
		}
	}
	else{
		for(k=0,i=la-1,j=lb-1;i>=0;i--,j--,k++){
			s[k]=a[i]-'0'+b[j]-'0';
			//cout<<k<<s[k]<<' '<<a[i]<<b[j]<<endl;
		}
		for(;j>=0;j--,k++){
			s[k]=b[j]-'0';
			//cout<<k<<s[k]<<' '<<a[i]<<b[j]<<endl;
		}
	}
	for(int i=0;i<k;i++){
		if(s[i]>=10){
			s[i]-=10;
			s[i+1]++;
		}
	}
	while(s[k]==0){
		k--;
		if(k==-1){
			cout<<'0'<<endl;
			return 0;
		}
	}
		for(int i=k;i>=0;i--){
			cout<<s[i];
		}
		cout<<endl;
	return 0;
}
main()
{
	char num1[MAX],num2[MAX];                                 
	int l1,l2,l,i,j,num[MAX],flg=1;                        //l????????????num????????????flg????????0?? 
	gets(num1);
	gets(num2);
	l1=strlen(num1);
	l2=strlen(num2);
	
	if (l1>l2)
		l=l1;
	else 
		l=l2;
	
	if (l1>l2)                                             //???????????????????num????????????????num??? 
	{
		j=l1-1;
		for (i=l2-1;i>=0;i--)
			{num[j]=num1[j]+num2[i]-'0'-'0';
			j--;}
		for (;j>=0;j--)
			num[j]=num1[j]-'0';
	}

	else
	{
		j=l2-1;
		for (i=l1-1;i>=0;i--)
			{num[j]=num2[j]+num1[i]-'0'-'0';
			j--;}
		for (;j>=0;j--)
			num[j]=num2[j]-'0';
	}


	for (i=l-1;i>0;i--)                                   //???????????10????????10?????1 
		{if (num[i]>=10)
				{num[i-1]++;
				num[i]=num[i]-10;}
		}

	if (num[0]>=10)                                       //??????????10?????? 
		{
			num[0]=num[0]-10;
			printf("1");
			flg=0;                                       //??flg=1????????0?? 
			}
	if (flg)                                             //?num???????????0??? 
		for (i=0;i<=l-1;i++)
			if (num[i]!=0)
				break;
	if (i<=l-1)                                           //????0?????????0????? 
	{
		for (;i<=l-1;i++)
			printf("%d",num[i]);}
	else printf("0");                                      //???0??????0 
	
	
}
int main()
{
    char ca[250],cb[250];
	int  *a,*b,*c,l,i,j;
	scanf("%s %s",ca,cb);
	l=strlen(ca);
	if(strlen(cb)>strlen(ca))
		l=strlen(cb);
	a=(int *)malloc(sizeof(int)*l);
	b=(int *)malloc(sizeof(int)*l);
	c=(int *)malloc(sizeof(int)*(l+1));
	for(i=0;i<l;i++)
	{
		a[i]=0;
		b[i]=0;
		c[i]=0;
	}
	c[l]=0;
	for(i=0;i<strlen(ca);i++)
		a[i]=ca[strlen(ca)-1-i]-'0';
	for(i=0;i<strlen(cb);i++)
		b[i]=cb[strlen(cb)-1-i]-'0';
	for(i=0;i<l;i++)
		c[i]=a[i]+b[i];
	for(i=0;i<l;i++)
	{
		if(c[i]>=10)
		{
			
			c[i+1]+=(c[i]/10);
			c[i]%=10;
		}
	}
	j=-1;
	for(i=l;;i--)
	{
		if(c[i]!=0)
		{
			j=i;
			break;
		}
	}
	if(j<0)
		printf("0");
	else
		for(i=j;i>=0;i--)
			printf("%d",c[i]);
		printf("\n");



	free(a);
	free(b);
	free(c);
	return 0;
}
int main()
{
   int max; //???????????
   int n;
   char a[300]; //??????????a?b
   char b[300];
   int aa[300]; //????????????aa?bb
   int bb[300];
   int h[300]; //?????
   int jinwei[300]; //?????????
   int i;
   for(i=0;i<300;i++) aa[i]=0;
   for(i=0;i<300;i++) bb[i]=0;

   cin.getline(a,300);
   cin.getline(b,300);
   int long1=strlen(a);
   int long2=strlen(b);
   for(i=1;i<=long1;i++) aa[i]=(int)a[long1-i]-48;
   for(i=1;i<=long2;i++) bb[i]=(int)b[long2-i]-48;
   if(long1>long2) max=long1;
   else max=long2;
   jinwei[0]=0;

   for(i=1;i<=max+1;i++)
   {
       if(aa[i]+bb[i]+jinwei[i-1]<10) //??????????????
       {h[i]=aa[i]+bb[i]+jinwei[i-1];
         jinwei[i]=0;
       }
       else
       {
           h[i]=aa[i]+bb[i]+jinwei[i-1]-10;
           jinwei[i]=1;
       }
   }
   for(i=max+1;i>=1;i--) //?????????0
   {
       if(h[i]!=0)
       {
           n=i;
           break;
       }
   }
   if(i==0) cout<<"0";
   else
   {
       for(i=n;i>=1;i--) cout<<h[i]; //???????
   }

   return 0;
}
int max(int a,int b)
{
	return(a>b?a:b);
}

void main()
{
	char a[251],b[251],c[251];
	int i,j,la=0,lb=0,m;
	for(i=0;i<251;i++)
		c[i]='0';
	for(i=0;;i++,la++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')
		{
			a[i]='0';
			break;
		}
	}
	for(i=0;;i++,lb++)
	{
		scanf("%c",&b[i]);
		if(b[i]=='\n')
		{
			b[i]='0';
			break;
		}
	}
	m=max(la,lb);
	for(i=0;i<la;i++)
		c[250-i]+=a[la-i-1]-48;
	for(i=0;i<lb;i++)
		c[250-i]+=b[lb-i-1]-48;
	for(i=250;i>250-m;i--)
		if(c[i]>'9')
		{
			c[i-1]+=(c[i]-48)/10;
			c[i]=48+(c[i]-48)%10;
		}
	for(i=250-m;i<250;i++)
	{
		if(c[i]=='0')
			continue;
		for(;i<250;i++)
			printf("%c",c[i]);
	}
	printf("%c\n",c[250]);
}
char a[255],b[255],c[255];
int plus(int l1,int l2)
{    
     int i,l;
    if(l1 > l2) l = l1;
    else l = l2;
   for(i = 0;i < l;i ++) 
     {
          b[i] = b[i] + c[i];
          if(b[i]>=10)
          {
            b[i] -= 10;
            b[i+1] ++;  
          }    
     }
    if(b[l]) l++;
    return l;
}
int main()
{
   int l1,l2,l;    
   int j;    
   scanf("%s",a);
   l1 = strlen(a); 
   getchar();
   for(j = 0;j < l1;j ++)
       b[l1-j-1] = a[j] - '0';
   scanf("%s",a);
   l2 = strlen(a); 
   for(j = 0;j < l2;j ++)
       c[l2-j-1] = a[j] - '0';
   l = plus(l1,l2); 
   while(b[l-1] == 0 && l)
   l--;  
   for(j = l-1;j >= 0;j--)
   printf("%c",b[j]+'0');
   if(l == 0) printf("0");
  return 0;    
}
int max(int a,int b);
void change();
int main()
{
	char a[210]={'0'},b[210]={'0'};
	int plusa[210]={0},plusb[210]={0},sum[210]={0},lena=0,lenb=0,len=0,i,j,maxpoint=0;
	cin>>a>>b;
	lena=strlen(a);
	lenb=strlen(b);
	for(i=0,j=lena-1;j>=0;j--){
		plusa[i++]=a[j]-'0';
	}
	for(i=0,j=lenb-1;j>=0;j--){
		plusb[i++]=b[j]-'0';
	}
	len=max(lena,lenb);
	for(i=0;i<len;i++){
		sum[i]=plusa[i]+plusb[i];
	}
	for(i=0;i<len;i++){
		if(sum[i]>=10){
			sum[i+1]=sum[i+1]+sum[i]/10;
			sum[i]=sum[i]%10;
		}
	}
	for(i=210-1;i>=0;i--){
		if(sum[i]!=0){
			maxpoint=i;
			break;
		}
	}
	for(i=maxpoint;i>=0;i--)
		cout<<sum[i];

	return 0;
}
int max(int a,int b)
{
	if(a>=b)return a;
	else return b;
}
const int MAX = 260;
int main()
{
	int i = 0,j = 0,k = 0,l = 0;
	int carry = 0 ;                //????
	int temp = 0;
	int len1 = 0,len2 = 0,bigger = 0;
	char ch1[MAX];
	char ch2[MAX];
	int num1[MAX];
	int num2[MAX];
	int result[MAX];
	cin>>ch1>>ch2;
	len1 = strlen(ch1);
	len2 = strlen(ch2);
	if(len1 > len2){bigger = len1;}
	else{bigger = len2;}
	for(j = 0;j < MAX;j++)
	{
		num1[j] = num2[j] = result[j] = 0;
	}
	for(i = 0;i <= len1 - 1;i++)
	{
		num1[MAX - len1 + i] = ch1[i] - '0';
	}
	for(i = 0;i <= len2 -1 ;i++)
	{
		num2[MAX - len2 + i] = ch2[i] - '0';
	}
	for(k = MAX - 1;k >= MAX - bigger;k--)
	{
		carry = 0;
		temp = num1[k] + num2[k] + result[k];
		if(temp < 10){result[k] = temp;carry = 0;}
		else{result[k] = temp % 10;carry = 1;}
		result[k - 1] = result[k -1] + carry;
	}
	for(l = 0;(l <= MAX -1) && (result[l] == 0);l++);
	if(l == MAX){cout<<'0';}
	else
	{
		for(i = l;i <= MAX - 1;i++)
		{
			cout<<result[i];
		}
	}
	return 0;
}
int main()
{
	char a[250], b[250], c[250], d[250], max[250], x[250], y[250];
	int i, min, up, max1;
	for (i=0; i<=249; i++)
	{
		a[i]='\0';
		b[i]='\0';
		c[i]='\0';
		d[i]='\0';
		max[i]='\0';
	}
	scanf("%s%s", a, b);
	for(i=0; i<=strlen(a)-1; i++)
	{
		if(a[i]=='0')
		{
			a[i] = '\0';
		}
		else break;
	}
	for(i=0; i<=strlen(b)-1; i++)
	{
		if(b[i]=='0')
		{
			b[i] = '\0';
		}
		else break;
	}
	min = (strlen(a)>strlen(b))?strlen(b):strlen(a);
	max1 = (strlen(a)>strlen(b))?strlen(a):strlen(b);
	if (strlen(b) == strlen(a)) strcpy(c, a);
	else
	{
		for(i=0; i<=max1-min-1; i++)
		{
			c[i] = 48;
		}
		strcat(c, (strlen(a)>strlen(b))?b:a);
	}
	strcpy(max, (strlen(a)<=strlen(b))?b:a);
	up = 0;
	for(i=strlen(c)-1; i>=0; i--)
	{
		if(max[i]+c[i]+up<106)
		{
			d[i] = c[i] + max[i] - 48 + up;
			up = 0;
		}
		else
		{
			d[i] = c[i] + max[i] - 48 - 10 + up;
			up = 0;
			up++;
		}
	}
	if (up!=0) printf("1%s\n", d);
	else printf("%s\n", d);
	return 0;
}