semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	const int MAX_LENTH=250;//???????????MAX_LENTH????250.
	unsigned an1[MAX_LENTH],an2[MAX_LENTH];//?????????????
	char seLine1[MAX_LENTH+1],seLine2[MAX_LENTH+1];//????????
	cin.getline(seLine1,MAX_LENTH+1);
	cin.getline(seLine2,MAX_LENTH+1);//?????????????
	int len1=strlen(seLine1),len2=strlen(seLine2);//?????
	memset(an1,0,sizeof(an1));
	memset(an2,0,sizeof(an2));//?????0,??????
	int i,j=0;
	for(i=len1-1;i>=0;i--){
		an1[j++]=seLine1[i]-'0';}//???????????????
	j=0;
	for(i=len2-1;i>=0;i--){
		an2[j++]=seLine2[i]-'0';}//???????????????
	for(i=0;i<MAX_LENTH;i++){
		an1[i]+=an2[i];//??????
		if(an1[i]>=10){
			an1[i]-=10;
			an1[i+1]++;}}//??
	i=MAX_LENTH-1;
	while(an1[i]==0){
		i--;}//???????0??
	if(i<0){
		cout<<0;}//?????0 0???
	else{
		for(;i>=0;i--){
			cout<<an1[i];}}//????
	cout<<endl;
	return 0;
}
int main()
{
    char a[260],b[260],c[260];
    int t,i,j,n,m,ca;
        scanf("%s\n%s",a,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<m;i++)
              a[i]-='0';
           for(i=0;i<n;i++)
              b[i]-='0';
           j=m-1;
           for(i=n-1;i>=0;i--,j--)
               a[j]+=b[i];
           for(i=m-1;i>0;i--)
           {
              if(a[i]>=10)
              {
                 a[i-1]++;
                 a[i]-=10;
              }}
              for(i=0;i<m;i++)
                { if(a[i]!=0)break;}
                 int q=i;
                 if (q==m)
                 printf("0");
                 else
                 for(i=q;i<m;i++)
                 printf("%d",a[i]);
              printf("\n"); 
    }
int main(){
	char a[250],b[250]; //????????
	cin>>a>>b; //?????
	int ia=strlen(a),ib=strlen(b); //??????????
	int i,k=0,j,sum,s[250]={0},com; //??i?????k?????j?????sum??????????s
	if(ia==ib) //????????????
	{
		com=ia; //?????com????
		for(i=com-1;i>=0;i--)
		{
			sum=a[i]+b[i]+k-96; //?????????48????????
			k=sum/10; //?????
			j=sum-k*10; //?????
			s[i+1]=j;
		}
		if(k!=0)
			s[0]=k;
	}
	else //???????
	{
		int max;
		if(ia>ib)
			max=ia;
		else
			max=ib;
		com=max;
		for(;ia!=0&&ib!=0;ia--,ib--,max--)
		{
			sum=a[ia-1]+b[ib-1]+k-96; //??????
			k=sum/10;
			j=sum-k*10;
			s[max]=j;
		}
		a[-1]='0';b[-1]='0';
		if(ia>ib)
		{
			for(;max>=0;max--)
			{
				sum=a[ia-1]+k-48; //??????
				k=sum/10;
				j=sum-k*10;
				s[max]=j;
				ia--;
			}
		}
		else
		{
			for(;max>=0;max--)
			{
				sum=b[ib-1]+k-48; //??????
				k=sum/10;
				j=sum-k*10;
				s[max]=j;
				ib--;
			}
		}
		if(k!=0)
	    	s[0]=k;
	}
	if(a[0]=='0'&&b[0]=='0'&&ia==1&&ib==1)
		cout<<"0"<<endl;
	else
	{
		int t;
		for(t=0;s[t]==0;t++)
			;
		for(i=t;i<=com;i++)
			cout<<s[i];
		cout<<endl;
	}
}
int main()
{
    int res[300],ls,lt,i,max,s1[300],t1[300];
    char s[300],t[300];
    memset(s,0,sizeof(s));
    memset(res,0,sizeof(res));
    scanf("%s",s);
    scanf("%s",t);
    {
        ls=strlen(s);
        lt=strlen(t);
        memset(s1,0,sizeof(s1));
        memset(t1,0,sizeof(t1));
        s1[0]=ls;
        for (i=1;i<=ls;i++)
            s1[i]=s[ls-i]-'0';
        t1[0]=lt;
        for (i=1;i<=lt;i++)
            t1[i]=t[lt-i]-'0';
        max=s1[0]>t1[0]?s1[0]:t1[0];
        for (i=1;i<=max;i++)
        {
            res[i]+=s1[i]+t1[i];
            if (res[i]>=10)
            {
                res[i+1]+=res[i]/10;
                res[i]%=10;
            }
            if (res[max+1]!=0)
                res[0]=max+1;
            else res[0]=max;
        }
    }
    for (i=res[0];res[i]==0;i--);
    if (i==0)printf("0");else
    for (;i>=1;i--)
        printf("%d",res[i]);

    printf("\n");
    return 0;
}
char a[250],b[250];//???????????????
int A[250],B[250],C[251]={0};//????????????????????????[249]?
int carrybit=0;//?carrybit?????
int m=-1;//?m???C?????????????
void add(int n){
	if(n<0){
		C[n+1]=carrybit;
		return;
	}
	C[n+1]=(A[n]+B[n]+carrybit)%10;
	carrybit=(A[n]+B[n]+carrybit)/10;
	add(n-1);
}
int main()
{
	int i=0;
	cin.getline(a,250);
	cin.getline(b,250);
	int al=strlen(a),bl=strlen(b);
	for(i=0;i<al;i++)
		A[250-al+i]=(int)a[i]-48;
	for(i=0;i<250-al;i++)
		A[i]=0;//????a????????A??
	for(i=0;i<bl;i++)
		B[250-bl+i]=(int)b[i]-48;
	for(i=0;i<250-bl;i++)
		B[i]=0;//????b????????B??
	add(249);
	for(i=0;i<251;i++)
		if(C[i]!=0){m=i;break;}
	if(m==-1)cout<<"0"<<endl;
	if(m>=0){
		for(i=m;i<251;i++)
			cout<<C[i];
		cout<<endl;
	}
	return 0;
}
int a;
    int an1[MAX+10]={0};
    int an2[MAX+10]={0};
    char szLine1[MAX+10]={0};
    char szLine2[MAX+10]={0};
int main()
{
    scanf("%s",szLine1);
    scanf("%s",szLine2);
    int i,j;
    int nLen1=strlen(szLine1);
    int nLen2=strlen(szLine2);
    j=0;
    for(i=nLen1-1;i>=0;i--)
    {
                           an1[j++]=szLine1[i]-'0';
    }
    j=0;
    for(i=nLen2-1;i>=0;i--)
    {
                           an2[j++]=szLine2[i]-'0';
    }
    for(i=0;i<MAX;i++)
    {
                      an1[i]+=an2[i];
                      if(an1[i]>=10)
                      {
                                    an1[i]-=10;
                                    an1[i+1]++;
                      }
    }
    for(i=MAX;i>=0;i--)
    {
                       if(an1[i]!=0)
                       {
                          a=i;
                          break;
                       }
                       
    }
    for(i=a;i>=0;i--)
    { 
    printf("%d",an1[i]);
    } 
    
}
main()
{
    char a[250],b[250],m[250];
    int c,d,i,e,j,k;
    scanf("%s %s",a,b);
    c=strlen(a);
    d=strlen(b);
    k=0;
    if(c<d)
    {
           for(i=0;i<d;i++)
           {
              m[i]=a[i];
              a[i]=b[i];
              b[i]=m[i];             
           }
           e=c;
           c=d;
           d=e;
    }
    if(c>d)
    {
           for(i=c-1;i>=c-d;i--)
           b[i]=b[i+d-c];
           for(i=0;i<c-d;i++)
           b[i]='0';
    }
    for(i=c-1;i>0;i--)
    {
           m[i]=a[i]+b[i]-'0';
           if(m[i]>'9')
           {
              m[i]=m[i]-10;
              a[i-1]=a[i-1]+1;
           }
    }
    m[0]=a[0]+b[0]-'0';
    if(m[0]>'9')
    {
       m[0]=m[0]-10;
       printf("1");
       for(i=0;i<c;i++)
       printf("%c",m[i]);
    }
    else
    {
        for(i=0;i<c;i++)
        {
        if(m[i]!='0')
        {
        for(j=i;j<c;j++)
        printf("%c",m[j]);
        k=1;
        }
       if(k==1)
       break;
        }
        if(k==0)
        printf("0");
    }
}
int countnum(char a[])
{
	int num=0;
	while(a[num]!='\0')
		num++;
	return num;
}

void  clean(char a[])
{
     int num=0;
     int lenth=0;
     while (a[lenth]!='\0')
     lenth ++;
     while(a[num]=='0')
     num++;
     for (int i=0;i<=(lenth-num);i++)
     {
         a[i]=a[i+num];
     }
}
     

void sort(char a[],int la,int max)
{
	int count=la;
	int differ=max-la;
	for(;count>=0;count--)
	{
		a[count+differ]=a[count];
	}
	for(int i=0;i<differ;i++)
		a[i]='0';
}

void entire(char a[],int la)
{
	char aa[1000];
	int count = la;
	for(;count>=0;count--)
	{
		aa[la-count]=a[count];
	}
	aa[la+1]='\0';
	for(int i=0;i<=la+1;i++)
	{
		a[i]=aa[i];
	}
}
int main()
{
	char a[1000];
	char b[1000];
	scanf("%s %s",a,b);
	//printf("%d",strlen(a));
	
	if((strlen(a)==1)&&(strlen(b)==1)&&(a[0]=='0')&&(b[0]=='0'));
	else
	{
	clean(a);
	clean(b);
    }
	//printf("%s\n%s\n",a,b);
	
	int la=countnum(a);
	int lb=countnum(b);
	int max=la;
	if(la<lb)max=lb;
	max=max+1;
	sort(a,la,max);
	sort(b,lb,max);
	max=max-1;
	entire(a,max);
	entire(b,max);
	int sign=0;
	char c[1000];
	for(int i=0;i<=max;i++)
	{
		int temp=sign+a[i]-'0'+b[i]-'0';
		if(temp>9)
		{
			sign =1;
			temp=temp-10;
		}
		else 
			sign=0;
		c[i]=temp+'0';
	}
	c[max+1]='\0';
	max=max;
	entire(c,max);	
	if(c[0]=='0')
	{
		for(int j=1;j<=max;j++)
			printf("%c",c[j]);
		printf("\n");
	}
	else
	{
    printf("%s\n",c);
	}
	
	
}
int main()
{
	char s[251];
	int a[251]={0},b[251]={0},c[252]={0},alen,blen,clen,m;
	int i,k=0;
	gets(s);
	alen=strlen(s);
	for(i=alen-1;i>=0;i--){
		a[alen-i]=s[i]-'0';
	}
	gets(s);
	blen=strlen(s);
	for(i=blen-1;i>=0;i--){
		b[blen-i]=s[i]-'0';
	}
	if(alen>blen){
		clen=alen;
	}else{
		clen=blen;
	}
	for(i=1;i<=clen;i++){
		c[i]=a[i]+b[i];
	}
	for(i=1;i<=clen;i++){
		if(c[i]>9){
			c[i+1]++;
			c[i]=c[i]-10;
			if(i==clen){
				clen++;
			}
		}
	}
	if(clen==1){
		printf("%d",c[clen]);
	}else{
		for(i=clen;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 main()
{
   char ch1[252],ch2[252],cha1[253],cha2[253],cha3[253];
   int i,j,len1,len2,jin;
   cin>>ch1;
   cin>>ch2;
   len1=strlen(ch1);
   len2=strlen(ch2);
   for(i=0;i<253;i++)
   {
       cha1[i]='0';
       cha2[i]='0';
       cha3[i]='0';
   }
   for(i=0;i<len1;i++)
   {
       cha1[i]=ch1[len1-1-i];

    }
    cout<<endl;
   for(i=0;i<len2;i++)
   {
       cha2[i]=ch2[len2-1-i];

    }
    cout<<endl;
    jin=0;
    for(i=0;i<253;i++)
    {
       if((cha1[i]-'0')+(cha2[i]-'0')+jin>=10)
       {
           cha3[i]='0'+(cha1[i]-'0')+(cha2[i]-'0')+jin-10;jin=1;
       }
       else
       {
           cha3[i]='0'+(cha1[i]-'0')+(cha2[i]-'0')+jin;jin=0;
       }
    }
    for(i=252;i>=0;i--)
    {
        if(cha3[i]!='0')break;
    }
if(i==-1)cout<<'0';
else
{
    for(j=i;j>=0;j--)
    cout<<cha3[j];
}

    return 0;
}
char s1[1000];
char s2[1000];
int a[1000];
int b[1000];
int c[1000];
int m ,n;
void cal()
{
	int i,j;
	int len;
	if(m>n)
	    len =m;
 	else
 	    len =n;
 	int   k=0;
 	int s = 0;
	for(i=0;i<len;i++)
	{
	
		s = (a[i]+b[i]+k)%10;
		k = (a[i]+b[i]+k)/10;
		c[i] = s;
	}
	c[i] =k;

}
int main()
{
	cin>>s1;
	cin>>s2;
	m = strlen(s1);
	n = strlen(s2);
	int i,j=0;;
	for(i=m-1;i>=0;i--)
		a[j++] = s1[i]-'0';
	j=0;
	for(i=n-1;i>=0;i--)
		b[j++] = s2[i]-'0';
	cal();
	for(i=999;i>0;i--)
	    if(c[i]!=0)
	        break;
	for(;i>=0;i--)
	    cout<<c[i];
 	cout<<endl;
    return 0;
}
int a[251],b[251];
int c[251];
int al,bl,cl,i;
void sr(){
    int s;
    for(s=0;s<=250;s++){
        a[s]=b[s]=c[s]=0;
    }
    for(al=0;(a[al]=(getchar()-'0'))!=('\n'-'0');al++){
    }a[al]=0;
    for(bl=0;(b[bl]=(getchar()-'0'))!=('\n'-'0');bl++){
    }b[bl]=0;
}
void addit(){
    int k;
    for(cl=1;(cl<=al)||(cl<=bl);cl++){
        k=c[cl-1];
        if(cl<=al) k+=a[al-cl];
        if(cl<=bl) k+=b[bl-cl]; 
        if(k>9){
            k-=10;
            c[cl]++;
        }        
        c[cl-1]=k;
    }
}
void sc(){
    int sign=0,m;cl--;
    for(m=0;m<=250;m++){
        if(c[250-m]!=0){
            cl=251-m;break;
        }
    }
    for(m=0;m<cl;m++){
        cout<<c[cl-m-1];
    }
}
int main(){
    sr();
    addit();
        sc();
    
    return 0;
}
int main()
{
	char s1[255], s2[255];
	int a, b, l1, l2, sum[255]={0}, l=0;
	scanf("%s %s", s1, s2);
	l1=strlen(s1);
	l2=strlen(s2);
	while(l1>0||l2>0)
	{
		a=(l1>0)?s1[--l1]-'0':0;
		b=(l2>0)?s2[--l2]-'0':0;
		sum[l]+=a+b;
		sum[l+1]=sum[l]/10;
		sum[l++]%=10;
	}
	while(sum[l]==0&&l>0)
	{
		l--;
	}
	for(;l>=0;l--)
	{
		printf("%d", sum[l]);
	}
	printf("\n");
	return 0;
}
int main()
{
    char a1[260]={0};
    char b1[260]={0};
    cin.getline(a1,260);
    cin.getline(b1,260);
    int i,j,k,l1,l2;
    l1=strlen(a1);
    l2=strlen(b1);
    int c[300]={0};
    int a[300]={0};
    int b[300]={0};
    j=0;
    for(i=l1-1;i>=0;i--)
    {
      a[j]=a1[i]-'0';
      j++;
    }
    j=0;
    for(i=l2-1;i>=0;i--)
    {
       b[j]=b1[i]-'0';
       j++;
    }
    for(i=0;i<300;i++)
    {
      c[i]=a[i]+b[i]+c[i];
      if(c[i]>=10)
      {
        c[i]=c[i]%10;
        c[i+1]++;
      }
    }
    j=299;
    while(c[j]==0)
    {
      j--;
    }
    for(;j>=0;j--)
    {
      cout << c[j];
    }
    if((a[0]==0)&&(b[0]==0))
    {
      cout << 0;
    }
    cout << endl;
    cin.get(); cin.get(); cin.get();
    return 0;
}
int main()
{
	char a[252],b[252];

	cin>>a>>b;
	int la=strlen(a);
	int lb=strlen(b);

	int flag=0;

	if(la<lb) 
	{
		int i=0,x;
		char temp[252];
		for(i=0 ;a[i]!='\0'; i++) temp[i]=a[i];temp[i]='\0';
		
		for(i=0 ;b[i]!='\0'; i++) {a[i]=b[i];}a[i]='\0';
		for(i=0 ;temp[i]!='\0'; i++) {b[i]=temp[i];}b[i]='\0';
		x=la;
		la=lb;
		lb=x;
	}//la>=lb

	int j,k=la-1;
	for(j=lb-1; j>=0 ;j--)
	{
		a[k]=a[k]+b[j]-48;
		if(a[k]>'9' && k!=0)
		{
			a[k]=a[k]-10;
			a[k-1]++;
		}
		if(a[k]>'9' && k==0 )
		{
			a[k]=a[k]-10;
			flag=1;
		}
		k--;
	}
	for(int i=la-1;i>=0;i--)
	{
		if(a[i]>'9' && i!=0) 
		{
			a[i]=a[i]-10;
			a[i-1]++;
		}
		if(a[i]>'9' && i==0 )
		{
			a[i]=a[i]-10;
			flag=1;
		}
	}
	int i=0;
	if(flag==1) cout<<1;
	if(flag==0)
	{
		for(i=0;a[i]!='\0';i++)
		{
			if(a[i]!='0')
				break;
		}
	}

	cout<<a+i;

	if(atoi(a)==0 && atoi(b)==0) cout<<0;



	return 0;
}
int main()
{
	char str1[252],str2[252];
	cin.getline(str1,252);
	cin.getline(str2,252);
	unsigned int a[251]={0},b[251]={0};
    int len1=strlen(str1);int len2=strlen(str2);
	int i,j=0;
	//????????0
	for (i=len1-1;i>=0;i--)
		a[j++]=str1[i]-'0';
	j=0;
	for(i=len2-1;i>=0;i--)
		b[j++]=str2[i]-'0';
	if(strcmp(str1,"0")!=0&&strcmp(str2,"0")!=0)
	{
	for (i=0;i<=250;i++)
	{
		a[i]=a[i]+b[i];
        if(a[i]>=10)
		{
			a[i]=a[i]-10;
			a[i+1]++;
		}
	}
	for(i=250;i>=0;i--)
	{
		if (a[i]!=0)//????0?????
			break;
	}
	for(;i>=0;i--)
		cout<<a[i];//?????????????
	cout<<endl;
	}
	else cout<<0;
	return 0;
}
int main()
{
	char A[300] = {0}, B[300] = {0};
	int a[300], b[300], i, j, k, n, len1, len2, c[300];
	memset(A, 0, sizeof(A));
	memset(B, 0, sizeof(B));
	cin >> A >> B;
	for (i = 0; A[i] != 0; i++);
	len1 = i;
	for (i = 0; B[i] != 0; i++);
	len2 = i;
	if (A[0] == '0' && B[0] == '0' && len1 == len2 && len1 == 1)
	{
		cout << '0' << endl;
	}
	else
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		memset(c, 0, sizeof(c));
		if (len2 > len1)
		{
			j = 0;
			for (i = len2 - 1; i >= 0; i--)
			{
				a[j] = B[i] - '0';
				j++;
			}
			j = 0;
			for (i = len1 - 1; i >= 0; i--)
			{
				b[j] = A[i] - '0';
				j++;
			}
			int t = len1;
			len1 = len2;
			len2 = t;
		}
		else
		{
			j = 0;
			for (i = len1 - 1; i >= 0; i--)
			{
				a[j] = A[i] - '0';
				j++;
			}
			j = 0;
			for (i = len2 - 1; i >= 0; i--)
			{
				b[j] = B[i] - '0';
				j++;
			}
		}
		for (i = 0; i < len1; i++)
		{
			c[i] += (a[i] + b[i]);
			if (c[i] >= 10)
			{
				c[i] = c[i] % 10;
				c[i + 1]++;
			}
		}
		for (i = 299; c[i] == 0; i--);
		if (i == -1)
			cout << '0' << endl;
		else
		{
			for (; i >= 0; i--)
				cout << c[i];
			cout << endl;
		}
	}
	return 0;
}
int MAX(int,int);
main()
{
      char a[251],b[251],c[251];
      int t=0,len1,len2,i,j,m;
      scanf("%s%s",a,b);
      len1=strlen(a);
      len2=strlen(b);
      if(len1<len2)
      { for(i=len1-1;i>=0;i--)
         {a[i+len2-len1]=a[i];
         }
for(i=0;i<=len2-len1-1;i++)
        {  a[i]='0';
        }
      }
      else if(len1>len2)
           {for(i=len2-1;i>=0;i--)
              {b[i+len1-len2]=b[i];
              }
            for(i=0;i<=len1-len2-1;i++)
              {  b[i]='0';
              }
           }
      m=MAX(len1,len2);
      for(i=0;i<=250;i++)
      {  c[i]='\0';
      }
      for(i=m-1;i>=0;i--)
      {c[i]=(a[i]-'0'+b[i]-'0'+t)%10+'0';
     /* printf("%c",a[i]);*/
       t=(a[i]-'0'+b[i]-'0'+t)/10;
      }
      if(t==1)
{ for(i=m-1;i>=0;i--)
           c[i+1]=c[i];
         c[0]='1';
       }
       len2=strlen(c);
       for(i=0;i<=len2-1;i++)
       {if(c[i]!='0')
          break;
       }
       
       if(i==len2)
          printf("0");
       else
         {for(j=i;j<=len2-1;j++)
           {  printf("%c",c[j]);
           } 
         } 
      } 
int MAX(int a,int b)
{
    if(a>=b)
      return a;
    else
      return b;
}
int c[300],d[300];
void plus(int i,int j,int a){
	if (i>=0) a+=c[i];
	if (j>=0) a+=d[j];
	if (i>=0||j>=0){
		plus(i-1,j-1,(a)/10);
		printf("%d",(a)%10);
	}else if (a) printf("%d",a);
}
int main(){
	char a[300];
	int i,j,n,m;
	scanf("%s",a);
	for (i=0;a[i]=='0'&&i<strlen(a);i++);
	for (j=i;i<strlen(a);i++) c[i-j]=a[i]-'0';
	n=i-j;
	scanf("%s",a);
	for (i=0;a[i]=='0'&&i<strlen(a);i++);
	for (j=i;i<strlen(a);i++) d[i-j]=a[i]-'0';
	m=i-j;
	plus(n-1,m-1,0);
	if (n-1<0&&m-1<0) printf("0\n");
	return 0;
}
int main()
{
    char str1[250],str2[250],str3[250],str4[250],str5[251];
    int a,b,c,i,j,k,p,q,r,s,t,u,v,w,x,y;
    scanf("%s\n",str1);
    scanf("%s",str2);
    a=strlen(str1);
    b=strlen(str2);
    if(a<b)
    {for(i=0;i<=249;i++)
    {str3[i]=str1[i];
    str1[i]=str2[i];
    str2[i]=str3[i];}}//?????????????????1????2 
    a=strlen(str1);
    b=strlen(str2);
    c=a-b;
    if(c>0)
    {
    for(j=0;j<=c-1;j++)
    str4[j]='0';
    for(k=c;k<=249;k++)
    str4[k]=str2[k-c];}
    else
    {
    for(p=0;p<=249;p++)
    str4[p]=str2[p];}//???????????????0 
    for(u=0;u<=250;u++)
    str5[u]='0';
    for(q=a-1;q>=0;q--)
    {
    r=str1[q]+str4[q]+str5[q+1]-144;
    if(r>9)
    {str5[q+1]=r-10+'0';
     str5[q]=str5[q]+1;}
    else
    str5[q+1]=r+'0';
    }//????? 
    for(v=0;v<=a;v++)
    {w=str5[v]-48;
    if(w!=0)
    {x=v;
    break;}
    else
    x=251;
    }
    if(251==x)
    printf("%d",0);
    else    
    {for(y=x;y<=a;y++)
    printf("%c",str5[y]);}//???????0?????? 
    //printf("%s",str5);
        }
int main()
{
	
	//int temp = 0;
	char temp[252];
	int a[252];
	int b[252];
	int ans[252];
	int j1 = 0;
	memset(ans,0,sizeof(ans));
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%s",temp);
	for(int i = strlen(temp)-1;i >= 0;i--)
	{
		a[j1++] = temp[i] - '0';
	}
	int j2 = 0;
	scanf("%s",temp);
	for(int i = strlen(temp)-1;i >= 0;i--)
	{
		b[j2++] = temp[i] - '0';
	}
	int j = max(j1,j2);
	memset(ans,0,sizeof(ans));
	for(int i = 0;i < j;i++)
	{
		ans[i] += a[i] + b[i];
		ans[i+1] +=ans[i]/10;
		ans[i] %= 10;
	}
	int key = 0;
	int tag = 0;
	for(int i = j;i >=0;i--)
	{
		if(ans[i] != 0)
			key = 1;
		if(key == 0)
			continue;
		cout<<ans[i];
		tag = 1;
	}
	if(tag == 0)
		cout<<0;
}
void main()
{
	char a[300]={'\0'},b[300]={'\0'},*p;
	int i,bb[300]={0},aa[300]={0},len,lena,lenb,start;

		
	gets(a);
	gets(b);

	lena=strlen(a);
	lenb=strlen(b);

	len=lena>lenb?lena:lenb;
	
		for(p=a,i=lena-1;p<a+lena;p++,i--)
		{
			aa[i]=*p-'0';
		}

			for(p=b,i=lenb-1;p<b+lenb;p++,i--)
		{
			bb[i]=*p-'0';
		}

		
	for(i=0;i<len;i++)
	{
		bb[i]=aa[i]+bb[i];
	
	}

	for(i=0;i<=len;i++)
	{
		if(bb[i]>=10)
		{
			bb[i]-=10;
			bb[i+1]++;
		}
	}

	start=0;

	for(i=len;i>=0;i--)
	{
	
		if(start)
		{
			printf("%d",bb[i]);
		}
		else if(bb[i]!=0)
		{
			printf("%d",bb[i]);
			start=1;
		}
	}
	if(!start) printf("0");

}
int max(int a,int b)
{
    if(a>=b)
    return a;
    else
    return b;
}
main()
{
    char a[300];
    char b[300];
    int c[300]={0};
    int d[300]={0};
    int p,u=0,v=0;
    int i,j,m,n,x=0,y=0;
    scanf("%s",a);
    scanf("%s",b);
        m=strlen(a);
        n=strlen(b);
    for(i=0;i<m;i++)
    {
        if(a[i]=='0')
        {
            u=0;
        }
        else
        {
            u++;
        }
    }
    for(j=0;j<n;j++)
    {
        if(b[j]=='0')
        {
            v=0;
        }
        else
        {
            v++;
        }
    }
    if(u==0&&v==0)
    {
        printf("%d",v);
    }
    else
    {
        for(i=m-1;i>=0;i--)
        {
            c[x]=a[i]-'0';
            x++;
        }
        for(j=n-1;j>=0;j--)
        {
            d[y]=b[j]-'0';
            y++;
        }
        for(i=0;i<max(m,n);i++)
        {
            if(c[i]+d[i]<10)
            {
                c[i]=c[i]+d[i];
            }
            else
            {
                c[i]=c[i]+d[i]-10;
                c[i+1]=c[i+1]+1;
            }
        }
        for(j=299;c[j]==0;j--)
        {
            p=0;
        }
        p=j;
        for(i=p;i>=0;i--)
        {
            printf("%d",c[i]);
        }
    }
}
int main()
{
	char a[251],b[251];
	cin>>a>>b;
	int a1=strlen(a);
	int b1=strlen(b);
	int num1[251]={0},num2[251]={0},j=0,i;
	for(i=a1-1;i>=0;i--)
	{
		num1[j]=a[i]-'0';
		j++;
	}
	j=0;
	for(i=b1-1;i>=0;i--)
		{
			num2[j]=b[i]-'0';
			j++;
		}
	j=0;
	int sum[251]={0};
	for(i=0;i<251;i++)
	{
		sum[i]=(num1[i]+num2[i]+j)%10;
		j=(num1[i]+num2[i]+j)/10;
	}
	for(i=250;i>=0;i--)
	{
		if(sum[i]!=0)
			break;
	}
	if(i==(-1))
		cout<<'0';
	for(j=i;j>=0;j--)
		cout<<sum[j];
	return 0;
}
void add(int a1[],int a2[],int b[],int a3[],int i)
{
	if(i==0){
		a3[i]=a1[i]+a2[i];
		if(a3[i]>=10){
			b[i]=1;
			a3[i]-=10;
		}
	}
	else{
		a3[i]=a1[i]+a2[i]+b[i-1];
		if(a3[i]>=10){
			b[i]=1;
			a3[i]-=10;
		}
	}
}

void main()
{
	char s1[MAX],s2[MAX];
	int a1[MAX-1]={0},a2[MAX-1]={0},b[MAX-1]={0},a3[MAX-1]={0},len1,len2,i,j;

	gets(s1);
	gets(s2);
	len1=strlen(s1);
	for(i=0;i<len1;i++)
		a1[i]=s1[len1-1-i]-48;
	len2=strlen(s2);
	for(i=0;i<len2;i++)
		a2[i]=s2[len2-1-i]-48;

	len1=(len1>len2)?len1:len2;
	for(i=0;i<=len1;i++){
		add(a1,a2,b,a3,i);
	}

	for(i=MAX-2;i>=0;i--){
		if(a3[i]!=0){
			break;
		}
	}

	if(i==-1)
		putchar('0');
	else{
		for(j=i;j>=0;j--)
			printf("%d",a3[j]);
	}
	printf("\n");
}
/*
 * temp.cpp
 *
 *  Created on: 2011-5-8
 *      Author: 10288
 */
void add(char * a,char *b);
int main()
{
	char a[301],b[301];
	cin >> a >> b;
	if(strcmp(a,"0")==0&&strcmp(b,"0")==0)
		cout << 0;
	else
	{
	if(strlen(a)>=strlen(b))
		add(a,b);
	else
		add(b,a);
	}

}
void add(char* a,char* b)
{
	char c[301];
	memset(c,'0',sizeof(c));
	int d[301],f[301];
	int l1=strlen(a);
	int l2=strlen(b);
	int i,t,j;
	for(i=l1-1;i>=0;i--)
		d[l1-1-i]=a[i]-'0';
	for(i=l2-1;i>=0;i--)
		f[l2-1-i]=b[i]-'0';
	for(i=l2;i<l1;i++)
		f[i]=0;
	for(i=0;i<l1;i++)
	{
		t=d[i]+f[i]+c[i]-'0';
		c[i]=t%10+'0';
		c[i+1]=t/10+'0';
	}
	for(i=200;i>=0;i--)
		if(c[i]!='0')
			break;
	for(j=i;j>=0;j--)
		cout << c[j];
}
int main()
{
	char input_string1[251],input_string2[251];
	char num1[252],num2[252];
	char result[252];
	result[251]='\0';
	scanf("%s",&input_string1);
	scanf("%s",&input_string2);
	memset(num1,'0',252);
	memset(num2,'0',252);
	strcpy(num1+(251-strlen(input_string1)),input_string1); 
	strcpy(num2+(251-strlen(input_string2)),input_string2);
	int i;
	int carry=0;
	for(i=250;i>=0;i--)
	{
		if((num1[i]-'0')+(num2[i]-'0')+carry>=10)
		{
			result[i]=(num1[i]-'0')+(num2[i]-'0')+carry-10+'0';
			carry=1;
		}
		else
		{
			result[i]=(num1[i]-'0')+(num2[i]-'0')+carry+'0';
			carry=0;
		}

	}
	for(i=0;i<=249;i++)
	{
		if(result[i]!='0')
		{
			break;
		}
	}
	printf("%s",result+i);

	return 0;
	
}
int main()
{
    char s1[256],s2[256];
    scanf("%s %s",s1,s2);
    int a,b,l1,l2,l=0;
    int c[256]={0};
    
    l1=strlen(s1);
    l2=strlen(s2);

    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++]=c[l]%10;
    }
    
    while (c[l]==0&&l>0)
        l--;
    for (int i=l; i>=0; i--)
        printf("%d",c[i]);
    return 0;
}
int lenA, lenB, maxLen;
void change(char a[300], int len)//??????????
{
	int q;
	for(int i=0;i<len/2;i++)
	{
		if(len-i-1==i)break;
		else{
			q=a[i];
		a[i]=a[len-i-1];
		a[len-i-1]=q;

		}
	}
}

int add(char c[300],char d[300],int x,char s[300])//???????????
{
	if(c[x]-'0'+d[x]-'0'<10)
	{
		s[x]=c[x]-'0'+d[x];
		if(x>=maxLen-1)return 0; //??????????
	}
	else
	{
		s[x]=c[x]-'0'+d[x]-10;//????????
		c[x+1]++;
		if(x>=maxLen-1)
		{
			s[x+1]++;
			maxLen++;
			return 0;
		}
	}
	return add(c,d,x+1,s);
}
int main()
{
	char a[300];
	char b[300];
	char c[300];
	for (int i = 0; i < 300; i++)
		a[i] = b[i] = c[i] = '0';
	cin>>a>>b;
	lenA = strlen(a);
	lenB = strlen(b);
	maxLen = lenA > lenB ? lenA : lenB;
	a[lenA] = b[lenB] = '0';
	change(a, lenA);
	change(b, lenB);
	add(a,b,0,c);
	for(int i=maxLen-1;i>=0;i--)//?c????
		{
			if (i == maxLen - 1 && i != 0 && c[i] == '0')
				continue;
			cout<<c[i];
		}
}