semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int trans(char x)
{
	
	int y;
	int s[10]={'0','1','2','3','4','5','6','7','8','9'};
	int i;
	for(i=0;i<10;i++)
	{
		if(x==s[i])
		{ 
			y=i;
			break;
		}
	}
	return y;
}
int main () 
{
	char a[250],b[250];
	int c[250],d[250],e[250],f[250];
	gets(a);
	gets(b);
	int na,nb;
	na=strlen(a);
	nb=strlen(b);
	int n;
	if(na>nb)
		n=na;
	else
		n=nb;
	int i,j;
	for(i=0;i<250;i++)
	{
		c[i]=0;
		d[i]=0;
		e[i]=0;
		f[i]=0;
	}
	for(i=n,j=na-1;j>=0;i--,j--)
	{   
		c[i]=trans(a[j]);
	}
	for(i=n,j=nb-1;j>=0;i--,j--)
	{   
		
		d[i]=trans(b[j]);
	}
	for(i=n;i>=0;i--)
	{
		if(i==n)
		{
			if(c[i]+d[i]<10)
				e[i]=c[i]+d[i];
			else
			{
				e[i]=c[i]+d[i]-10;
				f[i]=1;
			}
		}
		else
		{
			
				if(c[i]+d[i]+f[i+1]<10)
				e[i]=c[i]+d[i]+f[i+1];
			    else
				{
					e[i]=c[i]+d[i]+f[i+1]-10;
					f[i]=1;
				}
	
		}
	}
	int tmp=0;
	for(i=0;i<=n;i++)
	{
		if(e[i]!=0)
		{
			tmp=1;
			break;
		}
	}
	int m;
	for(i=0;i<=n;i++)
	{
		if(e[i]!=0)
		{
			m=i;
			break;
		}
	}
	
	
	if(tmp==1)
	{
      for(i=m;i<=n;i++)
		{
			printf("%d",e[i]);
		
		}
	}
	else
		printf("0");


	return 0;
			

}
int main()
{
    char a[250],b[250],sum[250];
    int k,l,m,i,flag=0;
    for(i=0;i<250;i++)
        a[i]=b[i]=sum[i]='0';
    scanf("%s %s",a,b);
    k=strlen(a);
    l=strlen(b);
    m=l>k? l:k;
    for(i=1;i<=m;i++)
    {
        sum[m-i]=a[k-i]-'1'+1+b[l-i]-'1'+1+flag;
        flag=0;
        if(sum[m-i]>9)
        {
            sum[m-i]-=10;
            flag=1;
        }
        sum[m-i]+='1'-1;
    }
    if(flag==1) printf("1");
    sum[m]='\0';
    if(flag!=1)
    {
    for(;sum[0]=='0';)
        for(i=0;i<m;i++) sum[i]=sum[i+1];
    if(sum[0]=='\0') sum[0]='0';
    }
    printf("%s",sum);
        return 0;
}
int main(){   
    int i,j,k=0,l,l1,l2,o=0;
    char a0[300],b0[300],a[300]={0},b[300]={0};
    scanf("%s %s",a0,b0);
    l1=strlen(a0);
    l2=strlen(b0);
    l=(l1>l2)?l1:l2;
    for(i=0;i<l1;i++){
        a[i]=a0[l1-1-i]-'0';
        }
    for(i=0;i<l2;i++){
        b[i]=b0[l2-1-i]-'0';
        }
    for(i=0;i<l;i++){
        a[i]=a[i]+b[i];
        if(a[i]>=10){
            a[i]=a[i]-10;
            a[i+1]++;
            }
        }
    for(i=l;i>=0;i--){
        if(a[i]==0) k++;
        else break;
        }
    if(k<l){
        for(i=l-k;i>=0;i--){
            printf("%d",a[i]);
            }
        }
    else{
        for(i=l;i>=0;i--){
            if(a[i]!=0) o=1;
            }
        if(o==0) printf("0");
        }
    
    
    scanf("%d",&i);
    return 0;
    }
main()
{
    int a,b,c,m,n,i,j,r;
    char x[1000];
    char y[1000];
    gets(x);
    gets(y);
    i=strlen(x);
    j=strlen(y);
    i--;
    j--;
    r=i>j?i:j;
    for(a=0;a<=i+1;a++)
    {
        x[r+1-a]=x[i+1-a];
        y[r+1-a]=y[j+1-a];
    }
    for(a=0;a<=r-i-1;a++)
    x[a]='0';
    for(a=0;a<=r-j-1;a++)
    y[a]='0';
    int z[1000]={0};
    m=0;
    for(a=r;a>=0;a--)
    {
        n=(x[a]-'0')+(y[a]-'0')+m;
        z[a]=n%10;
        m=n/10;
    }
    if(m==0)
    {
        for(a=0;a<=r;a++)
        {
            if(z[a]!=0)
            break;
            else;
        }
        if(a==r+1)
        printf("0");
        else;
        {
            for(b=a;b<=r;b++)
            printf("%d",z[b]);
        }
    }
    else
    {
        printf("%d",m);
        for(a=0;a<=r;a++)
        printf("%d",z[a]);
    }
}
//0507
//#include <queue>
//#include <map>
//#include <set>
const int MAX = 250;
char c1[MAX]={0};
char c2[MAX]={0};
//int a1[MAX]={0};
int a2[MAX]={0};
int re[MAX]={0};
int main()
{
	memset(a2,0,sizeof(a2));
	memset(re,0,sizeof(re));
	cin>>c1>>c2;
	//if(strcmp(c1,"0")==0&&c2=='0')
	int l1=strlen(c1); int l2=strlen(c2);
	int i,j;
	for(i=0;i<l1;i++)
		re[i]=c1[l1-i-1]-'0';
	for(i=0;i<l2;i++)
		a2[i]=c2[l2-i-1]-'0';
	int l;
	if(l1>=l2)
		l=l1;
	else
		l=l2;
	for(i=0;i<=l;i++)
	{
		re[i]=re[i]+a2[i];
		while(re[i]>=10)
		{
			re[i]-=10;
			re[i+1]+=1;
		}
	}
	i=201;
	while(re[i]==0&&i>-1)
		i--;
	if(i==-1)
		cout<<0;
	for(j=i;j>=0;j--)
		cout<<re[j];
	//cout<<endl;
	return 0;
}
int main(void)
{
    char a[255]="",b[255]="",f[255]="";
    int i,j,m,n,p,q,x,y;
    int c[255]={0},d[255]={0},e[255];
    scanf("%s",a);
    scanf("%s",b);
    i=0;while(a[i]=='0'){i++;}
    j=0;while(b[j]=='0'){j++;}
    for(x=0;x<255-i;x++)
    {a[x]=a[x+i];}
    for(y=0;y<255-j;y++)
    {b[y]=b[y+j];}
    if(a[0]=='\0'&&b[0]=='\0')
    {printf("0");}
    else
    {
    i=strlen(a);
    j=strlen(b);
    for(m=0;m<i;m++)
    {c[m]=a[i-1-m]-'0';}
    for(n=0;n<j;n++)
    {d[n]=b[j-1-n]-'0';}
    e[0]=c[0]+d[0];
    for(p=1;p<255;p++)
    {e[p]=c[p]+d[p]+e[p-1]/10;}
    for(p=0;p<255;p++)
    {e[p]=e[p]%10;}
    q=254;while(e[q]==0){q--;}
    for(x=0;x<q+1;x++)
    {f[x]=e[q-x]+'0';}
    printf("%s\n",f);
    }
      
}
int main()
{
	char a[250], b[250];
	int s[251]={0};
	int c=0;
	int p=0;
	int i, j;
	cin >> a >> b;
	for ( i=strlen(a)-1, j=strlen(b)-1; i >= 0 && j >= 0; i--, j-- )
	{
		s[c] += a[i]-'0'+b[j]-'0';
		if ( s[c]>9 )
		{
			s[c] -= 10;
			s[c+1]++;
		}
		c++;
	}
	if ( i == -1 )
	{
		for ( ; j >= 0; j-- )
		{
			s[c] += b[j]-'0';
			if ( s[c]>9 )
			{
				s[c] -= 10;
				s[c+1]++;
			}
			c++;
		}

	}
	else
	{
		for ( ; i >= 0; i-- )
		{
			s[c] += a[i]-'0';
			if ( s[c]>9 )
			{
				s[c] -= 10;
				s[c+1]++;
			}
			c++;
		}

	}
	for ( i=250; i >= 0; i-- )
		if ( s[i] == 0 && p == 0 )
			continue;
		else
		{
			p=1;
			cout << s[i];
		}
	if ( p == 0 )
		cout << "0";
	return 0;
}
void main(){
	int a[350],b[350],c[351];
	char s1[300],s2[300];
	int i,j,k,u,N,s;


		scanf("%s%s",s1,s2);
		j=0;
		while(s1[j]!='\0'){
			a[j]=s1[j]-'0';
			j++;
		}
		k=0;
		while(s2[k]!='\0'){
			b[k]=s2[k]-'0';
			k++;
		}

		u=0;
		s=0;//s????
		while((j>0)&&(k>0)){
			c[u]=a[j-1]+b[k-1]+s;
			s=c[u]/10;
			c[u]=c[u]%10;
			j--;k--;u++;
		}
/*????while?????????j>k?a????????????????*/
		while(j>0){
			c[u]=a[j-1]+s;
			s=c[u]/10;
			c[u]=c[u]%10;
			j--;u++;
		}
		while(k>0){
			c[u]=b[k-1]+s;
			s=c[u]/10;
			c[u]=c[u]%10;
			k--;u++;
		}
		if(s==1){//????????
			c[u]=s;
			u++;
		}
while(u>1&&c[u-1]==0)
u--;
		while(u>0){
				printf("%d", c[u-1]);
			u--;
		}
		printf("\n");

}
int main()
{
	int a1[Max+10]={0};
    int a2[Max+10]={0};
    char s1[Max+10];
    char s2[Max+10];
	int i,j,e,f;
	int L1,L2;
	scanf("%s",s1);
	scanf("%s",s2);
	L1=strlen(s1);
	L2=strlen(s2);
	j=0;
	if(L1==1&&L2==1)
	{
		e=s1[0]-'0';
		f=s2[0]-'0';
		printf("%d",e+f);

	}
	else
	{
	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<Max;i++)
	{
		a1[i]+=a2[i];
		if(a1[i]>=10)
		{
			a1[i]-=10;
			a1[i+1]++;
		}
	}
	
	for(i=Max;i>=0;i--)
	{
		if(a1[i]!=0)
		{
			j=i;
            break;
		}
	}
	for(i=j;i>=0;i--)
		printf("%d",a1[i]);
	}
	return 0;
}
int main()
{
	int a[300]={0};
	int i,len;
	int b[300]={0};
	int ans[300]={0};
	char z[300];
	scanf("%s",z);
	len=strlen(z);
	for(i=0;i<len;i++)
	{
		a[len-1-i]=z[i]-'0';
	}
	scanf("%s",z);
	len=strlen(z);
	for(i=0;i<len;i++)
	{
		b[len-1-i]=z[i]-'0';
	}
	for(i=0;i<300;i++)
	{
		ans[i]=a[i]+b[i];
	}

	for(i=0;i<300;i++)
	{
		if(ans[i]>=10)
		{
			ans[i+1]=ans[i+1]+(ans[i]/10);
			ans[i]=ans[i]%10;
		}
	}
	int mid=0;
	for(i=299;i>-1;i--)
	{
		if(ans[i]!=0)
		{
			mid=1;
		}
		if(mid==1)
		{
			printf("%d",ans[i]);
		}
	}
	if(mid==0)
	{
		printf("0");
	}
	printf("\n");
	return 0;
}
int i,j;
int len1,len2;
void f(char a[255],char b[255]){//???????
	int c[255];//???????
	if(len1>len2){//???????
		for(i=0;i<=len2-1;i++){
			c[i]=a[len1-1-i]+b[len2-1-i]-'0' -'0';//?????
			if(c[i]>=10){//??????
				c[i]-=10;
				a[len1-i-2]+=1;}//??
			}
		for(i=len2;i<=len1-2;i++){
			c[i]=a[len1-i-1]-'0';
		if(c[i]>=10){//??? ????
			c[i]-=10;
			a[len1-i-2]+=1;}
		}
		c[len1-1]=a[0]-'0';//?????
		if(c[len1-1]>=10){
			c[len1-1]-=10;
			c[len1]=1;
			j=len1;}//????
		else j=len1-1;
		int x=0,y=0;//???????
		for(i=j;i>=0;i--){//????
			if(c[i]==0&&x==0) continue;//????0
			else{
			cout << c[i];
			x=1;y=1;}}
		if(y==0)cout <<"0"<<endl;//???0???
	}
	else{//???????
		for(i=0;i<=len1-2;i++){
			c[i]=a[len1-1-i]+b[len2-1-i]-'0'-'0';
			if(c[i]>=10){
							c[i]-=10;
							a[len1-i-2]+=1;}
		}
		c[len1-1]=a[0]+b[0]-'0'-'0';
		if(c[len1-1]>10) {c[len1]=1;c[len1-1]-=10;j=len1;}
		else j=len1-1;
		int  x=0,y=0;
		for(i=j;i>=0;i--){
			if(c[i]==0&&x==0) continue;
			else{
			cout << c[i];
			x=1;y=1;}}
		if(y==0)cout <<"0"<<endl;
	}
}
int main(){//?????
	char a[255],b[255];
	cin >> a >> b;//??
	len1=strlen(a);
	len2=strlen(b);
	if(len1>=len2)//????????????
	f(a,b);
	else{//???????
		int y;
		y=len1;len1=len2;len2=y;
		f(b,a);
	}
	return 0;
}
int an1[MAX_LEN+10];
int an2[MAX_LEN+10];
char szLine1[MAX_LEN+10];
char szLine2[MAX_LEN+10];
int Add(int nMaxLen , int * an1, int * an2)
//?????? nMaxLen ???? an1?an2 ???????an1, 
//an1[0],an2[0]?????
{
	int nHighestPos = 0;
	for(int i = 0;i < nMaxLen; i ++ ) {	
		an1[i] += an2[i];		//????
		if( an1[i] >= 10 ) {		//??????	
			an1[i] -= 10;
			an1[i+1] ++;			//??
		}
		if( an1[i] )
			nHighestPos = i; //????????
	}
	return nHighestPos;
}
int main()   {
	scanf("%s", szLine1);  scanf("%s", szLine2);
	int i, j;
	//???memeset???an1???sizeof(an1)??????0
	//sizeof(an1)????an1???
	//memset???string.h???
	memset( an1, 0, sizeof(an1));	
	memset( an2, 0, sizeof(an2));
	//???szLine1???????????????an1???
	//an1[0]?????
	int nLen1 = strlen( szLine1);
	for(j =0, i = nLen1 - 1;i >= 0 ; i --)
		an1[j++] = szLine1[i] - '0';	
	int nLen2 = strlen(szLine2);
	for(j=0, i = nLen2 - 1;i >= 0 ; i --)
		an2[j++] = szLine2[i] - '0';
	int nHighestPos = Add(MAX_LEN,an1,an2);	
	for( i = nHighestPos; i >= 0; i -- )  printf("%d", an1[i]);
	return 0;
}
char a[252], b[252];
int an[252], bn[252], rn[252];
char res[252], temp[252];
int lenA, lenB, len;
void change()
{
	int i;
	for(i = 0; i < lenA; i ++)
	{
		an[i] = a[lenA - i - 1] - '0';
	//	cout << an[i];
	}
//	cout << endl;
	for(i = 0; i < lenB; i ++)
	{
		bn[i] = b[lenB - i - 1] - '0';
	//	cout << bn[i];
	}
	//cout << endl;
	if(lenA > lenB)
	{
		len = lenA;
		for(i = lenB; i < lenA; i ++)
			bn[i] = 0;
	}
	else if(lenB > lenA)
	{
		len = lenB;
		for(i = lenA; i < lenB; i ++)
			an[i] = 0;
	}
	else len = lenB;
//	cout <<"len: " << len << endl;
}
void addAB()
{
	int i;
	
	for(i = 0; i < len; i ++)
	{
		rn[i] += an[i] + bn[i];
		if(rn[i] > 9)
		{
			rn[i] = rn[i] - 10;
			rn[i + 1] ++;
		}
	}
//	cout << "len: " << i << ":  " << rn[i] << endl;
//		cout << len << endl;
	if(rn[i] == 1)
		len ++;
//	cout << len << endl;
	
	for(i = 0; i < len; i ++)
	{
		temp[i] = rn[len - i - 1] + '0';
//		cout << temp[i];
	}
//	cout << endl;
	int begin = 1;
//	cout << "temp[0]: " << temp[0] << endl;
//	if(temp[0] == 0)
//		begin = 1;
//	cout << "begin: " << begin << endl;
	while(temp[begin] == 0)
	{
		begin ++;
	}
	if(len == 1) begin = 0;
	if(temp[0] != '0') begin = 0;
//		cout << "len: " << len << endl;
//	cout << "begin: " << begin << endl;
	for(i = 0; i < len - begin; i ++)
		res[i] = temp[i + begin];
}

int main()
{
	
	
	cin.getline(a, 252);
	cin.getline(b, 252);
	lenA = strlen(a);
	lenB = strlen(b);
	memset(rn, 0, sizeof(rn));
	change();
	addAB();
	cout << res << endl;
	return 0;
}
int change(char *str,int *a){//??????????
	int len=strlen(str);//????????
	for(int i=0;i<len;i++)//???????
		a[len-i-1]=str[i]-'0';
	return len;//????
}
void printnum(int *a,int len){//?????
	int k=len-1;//k?????
	while(*(a+k)==0&&k>0){//???????????????????
		k--;
	}
	for(int i=k;i>=0;i--)//???????????
		cout<<*(a+i);
}
int jiafa(int *a,int alen, int *b, int blen,int *c){//????
	int len = ( alen > blen ) ? alen : blen;//?a?b??????????len
	for(int i=0;i<len;i++){//?????????
		c[i]=0;
		if(i<alen)c[i]+=a[i];
		if(i<blen)c[i]+=b[i];
	}
	c[len]=0;
	for(int i=0;i<len;i++)
		if(c[i]>=10){//??
			c[i+1]+=c[i]/10;
			c[i]=c[i]%10;
		}
	return c[len]? (len+1):len;//??len+1???????????????len?????
}

int main(){
	char n1[251],n2[251];
	int a[251],b[251],c[251],alen,blen,clen;
	cin.getline(n1,251);//?????
	cin.getline(n2,251);
	alen=change(n1,a);
	blen=change(n2,b);
	//??
	clen=jiafa(a,alen,b,blen,c);//?????????
	printnum(c,clen);//????
	return 0;
}
void main()
{
	int a[252]={0},b[251]={0};
	char c[250],d[250];
	int temp;
	scanf("%s",c);
	int i,j,m;
	for(i=strlen(c)-1,j=0;i>=0;i--,j++)
	{
		a[j]=c[i]-'0';
	}
	scanf("%s",d);
    for( i=strlen(d)-1,j=0;i>=0;i--,j++)
	{
		b[j]=d[i]-'0';
	}
	for( m=0;m<=250;m++)
	{
		temp=a[m]+b[m];
		a[m]=temp%10;
		a[m+1]=a[m+1]+temp/10;
	}
	for( m=251;m>=1;m--)
	{
		if (a[m]!=0)
		{
			break;
		}
	}
	for (m;m>=0;m--)
	{
		printf("%d",a[m]);
	}
}
int main()
{
	char s1[251],s2[251];
	int  a1[251]={0},a2[251]={0},len1,len2,len,t[251]={0},i;
	scanf("%s%s",s1,s2);
	len1=strlen(s1);
	len2=strlen(s2);
	if(len1>len2)len=len1;
	else len=len2;
	for(i=0;i<len1;i++)
	a1[i]=s1[len1-1-i]-'0';
	for(i=0;i<len2;i++)
	a2[i]=s2[len2-1-i]-'0';
	for(i=0;i<len;i++)
	{
		t[i]+=a1[i]+a2[i];
		if(t[i]>=10)
		{
			t[i]-=10;
			t[i+1]++;
		}
	}
	if(t[len]!=0)len++;
	for(i=len-1;i>0;i--)
	{
		if(t[i]==0)len--;
		else break;
	}
	for(i=len-1;i>=0;i--)
	printf("%d",t[i]);
	return 0;
}
int f(char x)
{
    int xx=x-'0';
	return xx;
}
int num1(int x,int y)
{
    if((x+y)>9)
      return x+y-10;
    else return x+y;
}
int num10(int x,int y)
{
    if((x+y)>9)
       return 1;
    else return 0;
}
int max(int x,int y)
{
    if(x>y)return x;
    else return y;
}
int main()
{
    char a[251],b[251],c[251];
    scanf("%s",a);
    scanf("%s",b);
    int la=strlen(a),lb=strlen(b);
    int mx=max(la,lb);
    int i,j,k,p=0;
    for(i=la-1,j=lb-1,k=0;k<mx;i--,j--,k++)
    {
       if(i>=0&&j>=0)
       {
         c[k]=num1(f(a[i]),f(b[j])+p);
         p=num10(f(a[i]),f(b[j])+p);
       }
       else if(i>=0&&j<0)
       {
         c[k]=num1(f(a[i]),p);
         p=num10(f(a[i]),p);
       }
       else 
       {
         c[k]=num1(f(b[j]),p);
         p=num10(f(b[j]),p);
       }
    }
    int frag=0;
    if(p==0)
      for(i=mx-1;i>=0;i--)
      {
         if(c[i]>0)frag=1;
         if(frag==1)
         printf("%d",c[i]);
         else if(i==0)printf("0");
      }
    else 
    {
         c[mx]=1;
         for(i=mx;i>=0;i--)printf("%d",c[i]);
    }
    
    return 0;
}
int main()
{
	char a[500], b[500];
	cin >> a >> b;
	int length1 =0, length2 = 0, c = 0, i = 0, flag1 = 1;
	length1 = strlen(a);
	length2 = strlen(b);
	int a1[501], b1[501];
	int result[501];
	memset(a1,0,sizeof(a1));
	memset(b1,0,sizeof(b1));
	memset(result,0,sizeof(result));
	for(i = 0; i <= length1 - 1; i++)
	{
		a1[length1 - 1 - i] = a[i] - '0';
	}
	for(i = 0; i <= length2 - 1; i++)
	{
		b1[length2 - 1 - i] = b[i] - '0';
	}
	for(i = 0; i <= 500; i++)
	{
		result[i] = a1[i] + b1[i] + result[i];
		if(result[i] >= 10)
		{
			result[i+1] = result[i] / 10 + result[i+1];
			result[i] = result[i] % 10;
		}
	}
	for(i = 500; i >= 0; i--)
	{
		if(result[i] != 0)
		{
			flag1 = 0;
			break;
		}
	}
	c = i;
	if(flag1 == 0)
	{
		for(i = c; i >= 0; i--)
		{
			cout << result[i];
		}
		cout << endl;
	}
	if(flag1 == 1)
	{
		cout << 0 << endl;
	}
	return 0;
}
//2981?????
// sst 2012.8.8 
int main()
{
    char str1[MAX_LEN+10],str2[MAX_LEN+10];
    int  an1[MAX_LEN+10],an2[MAX_LEN+10]; 
    int i,j; 
    gets(str1);
    gets(str2);
    memset(an1,0,sizeof(an1));
    memset(an2,0,sizeof(an2));
   int  Lenth1=strlen(str1);
   for(j=0,i=Lenth1-1;i>=0;i--,j++)
       an1[j]=str1[i]-'0';
   int Lenth2=strlen(str2); 
   for(j=0,i=Lenth2-1;i>=0;i--,j++)
       an2[j]=str2[i]-'0';
       int Highestpos=0;   
   for(int i=0;i<MAX_LEN;i++)
   {
          an1[i]=an1[i]+an2[i];
          if(an1[i]>=10)
          {
                       an1[i]=an1[i]-10;
                       an1[i+1]=an1[i+1]+1;
          }
          if(an1[i]) 
            Highestpos=i;
   }
   for(i=Highestpos;i>=0;i--)
   cout<<an1[i];
   return 0;
}
int max(int a,int b)
{
    int z;
    if(a>=b)
    z=a;
    else
    z=b;
    return(z);
}
int main()
{
    int max(int a,int b);
    int i,n,x=0;
    char str1[252],str2[252],str3[252],str4[252];char s[252];
    scanf("%s",str3);
    scanf("%s",str4);
    for(i=0;i<strlen(str3);i++)
    str1[strlen(str3)-i-1]=str3[i];
    for(i=strlen(str3);i<251;i++)
    str1[i]='0';
    for(i=0;i<strlen(str4);i++)
    str2[strlen(str4)-i-1]=str4[i];
    for(i=strlen(str4);i<251;i++)
    str2[i]='0';
    for(i=0;i<251;i++)
    s[i]='0';
    for(i=0;i<=max(strlen(str3),strlen(str4));i++)
    {
        s[i]=str1[i]+str2[i]+s[i]-'0'-'0';
        if(s[i]>'9')
        {
            s[i]=s[i]-10;
            s[i+1]='1';
        }
    }
    for(i=max(strlen(str3),strlen(str4))+1;i>=0;i--)
    {
        if(s[i]!='0')
        {
            for(i=i;i>=0;i--)
            printf("%c",s[i]);
            x++;
        }
    }
    if(x==0)
    printf("%d",x);

    return 0;
}
char a[252];
	char b[252];
	void sum(int n)
	{
		int flag=0;
		int j=n-1;
		char c[252];
		char tem='0';
		while(j>=0)
		{
			c[j+1]=(a[j]+b[j]-48-48+(tem-48))%10+48;
			tem=48+((a[j]+b[j]-48-48+(tem-48))/10);
			j--;

		}
		if(tem=='0')
			for(int i=1;i<=n;i++)
				{if(c[i]!='0'||flag!=0)
				{cout<<c[i];flag=1;}

				}
		else {
			c[0]=tem;
			for(int i=0;i<=n;i++)
			{
				if(c[i]!='0'||flag!=0)
				{	cout<<c[i];flag=1;}


			}


		}
		if(flag==0) cout<<"0";

	}
int main()
{
	cin.getline(a,252);
	cin.getline(b,252);
	int la,lb;
	la=strlen(a);
	lb=strlen(b);
	if(la>lb)
	{
		for(int i=la-1;i>=la-lb;i--)
			b[i]=b[i-la+lb];
		for(int i=0;i<la-lb;i++)
			b[i]='0';

          sum(la);
	}
	else
	{
		for(int i=lb-1;i>=lb-la;i--)
					a[i]=a[i-lb+la];
				for(int i=0;i<lb-la;i++)
					a[i]='0';
				sum(lb);

	}
	return 0;
	}
int main()
{
	int i,j=0;
	char a1[300],a2[300];
	int b1[300],b2[300];
	cin.getline(a1,300,'\n');
	cin.getline(a2,300,'\n');
	for(i=0;i<300;i++)
	{
		b1[i]=0;
		b2[i]=0;
	}
	for(i=strlen(a1)-1;i>=0;i--)
		b1[strlen(a1)-i]=a1[i]-'0';
	for(i=strlen(a2)-1;i>=0;i--)
		b2[strlen(a2)-i]=a2[i]-'0';
	for(i=1;i<300;i++)
	{
		b1[i]=b1[i]+b2[i];
		if(b1[i]>9)
		{
			b1[i]=b1[i]-10;
			b1[i+1]=b1[i+1]+1;
		}
	}
	for(i=299;i>=1;i--)
	{
		if(b1[i]!=0)
		{
			j=i;
		    break;
		}
		if(i==1)
		{
			cout<<'0';
		    return 0;
		}
	}
	for(i=j;i>=1;i--)
		cout<<b1[i];
	return 0;
}
void main()
{
	char s1[251]={""},s2[251]={""},sum[251]={""},temp[251]={""};
	int i,j,k,r=0,len1,len2,a[251]={0};

	gets(s1);gets(s2);


	len1=strlen(s1);len2=strlen(s2);
	k=len1>len2?len1-1:len2-1;
	for(i=k;i>=0;i--)
	{
		if(k==len1-1)
		{
		if(i-(k-len2+1)>=0)
		  a[i]=(s1[i-(k-len1+1)]-48)+(s2[i-(k-len2+1)]-48);
		else a[i]=s1[i-(k-len1+1)]-48;
		}
	   else
	   {
		if(i-(k-len1+1)>=0)
		  a[i]=(s1[i-(k-len1+1)]-48)+(s2[i-(k-len2+1)]-48);
		else a[i]=s2[i-(k-len2+1)]-48;
	   }
	}
	for(i=k;i>=1;i--)
		if(a[i]>=10){a[i-1]+=a[i]/10;a[i]=a[i]%10;}
	for(i=0;i<=k;i++)
		if(a[i]!=0) {r=i; break;}

    for(i=r;i<=k;i++)  
	printf("%d",a[i]);
	printf("\n");

}
main()
{
char *p;
int a,b,c,i,k=0;
static char x[252];
static char y[252];
static char z[252];
gets(x);
gets(y);
a=strlen(x);
b=strlen(y); 
for(i=a-1;i>=0;i--)
   x[i+251-a]=x[i];
for(i=250-a;i>=0;i--)
   x[i]='0';
for(i=b-1;i>=0;i--)
   y[i+251-b]=y[i];
for(i=250-b;i>=0;i--)
   y[i]='0';  
for(i=250;i>=0;i--)
  { 
      c=x[i]+y[i]-'0'-'0'+k;
      if(c<=9) 
     {z[i]=c+'0';k=0;}
     if(c>9)  
     {z[i]=c%10+'0';k=1;}
  }
{for(i=0;i<=250;i++)
  { if(z[i]!='0') {p=&z[i];break;}}
if(i==251)
  printf("0");
else
printf("%s",p);}
}
char  s[100001];
int   a[100001],b[100001],c[100001];
int main(){
    long i,j,k,m=0;
    long alen,blen,clen;
    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]-=10;
            if(i==clen)
                clen++;//????
        }
    for(i=clen;i>=1;i--)
	{
		if(c[i]!=0){
		    m=i;
			break;
		}
	}
    if(m==0){
		for(i=clen;i>=1;i--)
			printf("%d",c[i]);
	}
    if(m!=0){
		for(i=m;i>=1;i--)
			printf("%d",c[i]); 
	}
    printf("\n");     
}
main()
{
      int m,n,t,k,i,x1,x2,a[251];
      t=0;
      m=0;
      n=0;
      char str1[250],str2[250];
      for(i=0;i<250;i++)
      a[i]=0;
      scanf("%s",str1);
      scanf("%s",str2);
      x1=strlen(str1);
      x2=strlen(str2);
      if(x1>x2)
      {
               for(i=(x1-x2-1);i>=0;i--)
               a[i]=a[i]+str1[i]-'0';
      for(i=x1-1;i>=(x1-x2);i--)
      {
                 a[i]=a[i]+str1[i]+str2[i+x2-x1]-'0'-'0';
                 if(a[i]>=10)
                 for(k=i;k>=1;k--)
                 {
                     a[k-1]=a[k-1]+1;
                     a[k]=a[k]%10;
                     if(a[k-1]<10)
                     break;
                 }
      }
      for(i=0;i<=x1-1;i++)
      {
             if(a[i]!=0||a[i]==0&&t!=0)
             {
             printf("%d",a[i]);
             t=1;
             }
             if(i==1&&t==0)
             printf("0");
      }
      }
     else if(x1<x2)
      {
                        for(i=(x2-x1-1);i>=0;i--)
          a[i]=a[i]+str2[i]-'0';
          for(i=x2-1;i>=(x2-x1);i--)
          {
                 a[i]=a[i]+str1[i+x1-x2]+str2[i]-'0'-'0';
                 if(a[i]>=10)
                 for(k=i;k>=1;k--)
                 {
                 a[k-1]=a[k-1]+1;
                 a[k]=a[k]%10;
                 if(a[k-1]<10)
                 break;
                 }
          }
          for(i=0;i<x2;i++)
          {
                           if(a[i]!=0||a[i]==0&&m!=0)
                           {
                            printf("%d",a[i]);
                            m=1;
                            }
                            if(i==1&&m==0)
                            printf("0");
          }
      }
      else
      {
          for(i=x1-1;i>=0;i--)
          {
          a[x1-i-1]=a[x1-i-1]+str1[i]+str2[i]-'0'-'0';
          if(a[x1-1-i]>=10)
          {
                 a[x1-i]++;
                 a[x1-1-i]=a[x1-1-i]%10;
          }
          }
          if(a[x1]!=0)
          for(i=x1;i>=0;i--)
          printf("%d",a[i]);
          else
          for(i=x1-1;i>=0;i--)
          {
                 if(a[i]!=0||a[i]==0&&n!=0)
                 {
                 printf("%d",a[i]);
                 n=1;
                 }
                 if(i==0&&n==0)
                 printf("0");
          }
      }
      
}
int n1[251]={0},n2[251]={0};
char s1[251],s2[251];
void main()
{
scanf("%s",s1);
scanf("%s",s2);
int i,j;
int l=strlen(s1);
j=0;
for(i=l-1;i>=0;i--)
n1[j++]=s1[i]-'0';
l=strlen(s2);
j=0;
for(i=l-1;i>=0;i--)
n2[j++]=s2[i]-'0';
for(i=0;i<250;i++)
{
n1[i]+=n2[i];
if(n1[i]>9)
{n1[i]-=10;n1[i+1]++;}
}
int b=0;
for(i=250;i>=0;i--)
{
if(b)
printf("%d",n1[i]);
else if(n1[i])
{printf("%d",n1[i]);b=1;}
}
if(b==0)
printf("0");
}
char s1[200],s2[200];
int a[200],b[200],c[200];
int alen,blen,clen;

int str2bigint(char*str,int*t)
{
	int len=(int)strlen(str);
	int i;
	for(i=0;i<len;i++)
		t[i]=str[len-i-1]-'0';
	return len;
}

void print_int(int*a)
{
	int k=199;
	int i;
	while(a[k]==0&&k>0)
		k=k-1;
    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 temp = 0;
	int tmpsum = 0;
	int len=(alen>blen)?alen:blen;
	for(i=0;i<len;i++)
	{
		tmpsum = a[i] + b[i] + temp;
		c[i] = tmpsum % 10;
		temp = tmpsum /10;
	}
	if( temp != 0)
	{
		c[len] = temp;
		return len+1;
	}
	else
		return len;
}

int main(int argc, char*argv[])
{
	//int N,i;
    
	//scanf("%d",&N);
   // for(i=1;i<=N;i++)
	//{
		scanf("%s%s",s1,s2);

		alen=str2bigint(s1,a);
		
		blen=str2bigint(s2,b);
	
		clen=add_bigint(a,alen,b,blen,c);
		print_int(c);
//}
		return 0;
}