semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char num1[252],num2[252];
	int temp1[252]={0},temp2[252]={0},answer[255]={0};
	int len1,len2;
	int i,j;

	cin>>num1>>num2;
	len1=strlen(num1);
	len2=strlen(num2);

	for (i=len1-1,j=0;i>=0;i--)
		temp1[j++]=num1[i]-'0';
	for (i=len2-1,j=0;i>=0;i--)
		temp2[j++]=num2[i]-'0';

	for (i=0;i<len1||i<len2;i++)
	{	
		answer[i] += temp1[i]+temp2[i];
		if (answer[i]>=10)
		{
			answer[i+1]+=answer[i]/10;
			answer[i]=answer[i]%10;
		}
	}

	while(answer[i]==0)
		i--;

	for (j=i;j>=0;j--)
		cout<<answer[j];

	if (i<0)
		cout<<'0';


	return 0;
}
int main()
{
	int i,k;
	char s1[251],s2[251];
	int num_1[251]={0},num_2[251]={0};
	int len_1,len_2,len;
	int state=0;

	gets(s1);
	gets(s2);
	len_1=strlen(s1);
	len_2=strlen(s2);
	len=(len_1>len_2)?len_1:len_2;
	for(i=len_1-1,k=0;i>=0;i--)
		num_1[k++]=s1[i]-'0';
	for(i=len_2-1,k=0;i>=0;i--)
		num_2[k++]=s2[i]-'0';
	for(i=0;i<len;i++)
	{
		if(num_1[i]+num_2[i]>=10)
		{
			num_1[i]=(num_1[i]+num_2[i])%10;
			num_1[i+1]+=1;
		}
		else 
			num_1[i]=num_1[i]+num_2[i];
	}
	for(i=len;i>=0;i--)
	{
		if(len==1&&num_1[0]==0){
			printf("0");
			break;
		}
		else if(state==0&&num_1[i]==0)
			continue;
		state=1;
		printf("%d",num_1[i]);
	}
	printf("\n");
	return 0;
}
int main()
{
	char a[300];
	char b[300];
	int c[300]={0};
	cin>>a;
	cin>>b;
	int lena,lenb;
	lena=strlen(a);
	lenb=strlen(b);
	int i,k1,k2,k;
	k1=lena-1;
	k2=lenb-1;
	k=0;
	for(i=299;i>=0;i--)
	{
		if(k1<0&&k2<0)
			break;
		if(k1>=0&&k2>=0)
			c[i]+=(a[k1]-'0')+(b[k2]-'0');
		if(k1>=0&&k2<0)
			c[i]+=a[k1]-'0';
		if(k1<0&&k2>=0)
			c[i]+=b[k2]-'0';
		if(c[i]>=10)
		{
			c[i]=c[i]%10;
			c[i-1]=1;
		}
		k1--;
		k2--;
		
	}
	k=-1;
	for(i=0;i<300;i++)
	{
		if(c[i]!=0)
		{
			k=i;
			break;
		}
	}
	if(k==-1)
		cout<<'0'<<endl;
	else
	{
		for(i=k;i<300;i++)
			cout<<c[i];
		cout<<endl;
	}
	return 0;
}
int high(int *, int *,int);
const int maxmax = 200;
char a[maxmax + 1], b[maxmax + 1];
int aa[maxmax + 1], bb[maxmax];
int main()
{
	cin.getline(a,201);
	cin.getline(b,201);
	memset(aa, 0, sizeof(aa));
	memset(bb, 0, sizeof(bb));
	int length1 = strlen(a), length2 = strlen(b);
	int i, j;
	for (i = 0, j = length1 - 1; j >= 0; j--)
	{
		aa[i++] = a[j] - '0';
	}
	for (i = 0, j = length2 - 1; j >= 0; j--)
	{
		bb[i++] = b[j] - '0';
	}
	if (aa[0] == 0 && bb[0] == 0)
		cout<<0<<endl;
	else
	{
		int highest = high(aa, bb, maxmax + 1);
		for (i = highest; i >= 0; i--)
		{
			cout<<aa[i];
		}
	}
	return 0;
}
int high(int *a1, int *b1, int m)
{
	int d;
	for (int i = 0; i < m; i++)
	{
		a1[i] += b1[i];
		if (a1[i] >= 10)
		{
			a1[i] -= 10;
			a1[i + 1] += 1;
		}
		if (a1[i] != 0)
			d = i;
	}
	return d;
}
void rev(char *x);
int val(char a);

int main()
{
    char a[260],b[260],sum[260];
    int i,tmp=0,sign=0;
    for (i=0;i<260;i++)
    {
        a[i]=0;
    }    
    for (i=0;i<260;i++)
    {
        b[i]=0;
    }    
    for (i=0;i<260;i++)
    {
        sum[i]=0;
    }    
    gets(a);
    gets(b);
    rev(a);
    rev(b);
    for (i=0;i<=strlen(a) || i<=strlen (b);i++)
    {
        sum[i]=val(a[i])+val(b[i])+tmp+'0';
        if (sum[i]>'9')
        {
            sum[i]=sum[i]-10;
            tmp=1;
        }    
        else tmp=0;
    }    
    for (i=strlen(sum)-1;i>=0;i--)
    {
        if (i==0) sign=1;
        if (sum[i]!='0' || sign==1)
        {
            printf("%c",sum[i]);
            sign=1;
        }     
    }    
    return 0;
}   

void rev(char *x)
{
    int i,tmp,l;
    l=strlen(x);
    for (i=0;i<=l/2-1;i++)
    {
        tmp=x[i];
        x[i]=x[l-i-1];
        x[l-i-1]=tmp;
    }   
}     

int val(char a)
{
    if (a>'0' && a<='9') return a-48;
    else return 0;
}
int main()
{
	char a[300],b[300],c[300];
	int lena,lenb,add=0;
	cin>>a>>b;
	lena=strlen(a)-1;
	lenb=strlen(b)-1;
	int cl=0;
	for (;lena>=0&&lenb>=0;lena--,lenb--)
	{
		add+=a[lena]+b[lenb]-2*'0';
		c[cl++]=add%10;
		add/=10;
	}
	while (lena>=0)
	{
		add+=a[lena--]-'0';
		c[cl++]=add%10;
		add/=10;
	}
	while (lenb>=0)
	{
		add+=b[lenb--]-'0';
		c[cl++]=add%10;
		add/=10;
	}
	if (add!=0)
	{
		c[cl++]=add;
	}
	cl--;
	while (cl>=0&&c[cl]==0)
	{
		cl--;
	}
	if (cl==-1)
	{
		printf("0");
	}
	for (;cl>=0;cl--)
	{
		printf("%c",c[cl]+'0');
	}
	return 0;
}
const int len=300;
char a[len],b[len];
int an[len],bn[len];

int main()
{
	cin>>a>>b;	
	memset(an,0,sizeof(an));
	memset(bn,0,sizeof(bn));
	int lena=strlen(a);
	int lenb=strlen(b);
	int i=0;
	int j=0;
	for(i=lena-1;i>=0;i--)
		an[j++]=a[i]-'0';
	j=0;
	for(i=lenb-1;i>=0;i--)
		bn[j++]=b[i]-'0';
	for(i=0;i<210;i++)
	{
		an[i]+=bn[i];
		if(an[i]>9)
		{
			an[i]-=10;
			an[i+1]++;
		}
	}
	i=len-3;
	while(an[i]==0&&i>0)
		i--;
	if(i==0)
		cout<<an[0];
	else
		for( ;i>=0;i--)
			cout<<an[i];
}
int main()
{ 
	char a[251],b[251];
	int A[251]={0},B[251]={0},c[251]={0},i,p;
	cin.getline(a,251);
	cin.getline(b,251);
	for(i=strlen(a)-1;i>=0;--i)
		A[strlen(a)-1-i]=a[i]-'0';
	for(i=strlen(b)-1;i>=0;--i)
		B[strlen(b)-1-i]=b[i]-'0';
	for(i=0;i<251;++i)
	{
		p=A[i]+B[i];
		if(p+c[i]>9)
		{
			c[i]=(p+c[i])%10;
			c[i+1]++;
		}
		else
			c[i]+=p;
	}
	for(i=250;i>=0;i--)
	{
		if(c[i]!=0)
			break;
	}
	if(i!=-1)
	{
	for(p=i;p>=0;p--)
		cout<<c[p];
	}
	else 
		cout<<0;
}
int main()
{
	char str1[260], str2[260];
	int num1[260]={0}, num2[260]={0}, len1, len2, i, j, len;
	cin >> str1 >> str2;
	len1 = strlen(str1);
	len2 = strlen(str2);
	for (i = 0; i < len1; i ++)
	{
		num1[i] = str1[len1-i-1] - '0';
//		cout << num1[i];
	}
//	cout << endl;
	for (i = 0; i < len2; i ++)
	{
		num2[i] = str2[len2-i-1] - '0';
//		cout << num2[i];
	}
//	cout << endl;
	len = (len1 > len2 ? len1 : len2);
	for (i = 0; i < len; i ++)
	{
		num1[i] += num2[i];
		if (num1[i] >= 10)
		{
			num1[i] -= 10;
			num1[i+1] ++;
		}
//		cout << num1[i] << " ";
	}
//	cout << endl;
	for (i = 259; i > 0; i --)
	{
		if (num1[i] != 0)
			break;
	}
	for (; i >= 0; i --)
		cout << num1[i];
	return 0;
}
int main()
{
	char a[200], b[200];
	int at[200] = {0}, bt[200] = {0}, ans[201] = {0};
	int i, j, A, B, max = 0;
	cin.getline(a, 200);
	cin.getline(b, 200);
	A = strlen(a);
	B = strlen(b);	
	for (i = 0; i < A; i++)
		at[i] = a[A - i - 1] - '0';
	for (i = 0; i < B; i++)
		bt[i] = b[B - i - 1] - '0';
	if (A > B)
	{
		max = A;
		for (i = B; i < A; i++)
			bt[i] = 0;
	}
	else if (B > A)
		{
			max = B;
			for (i = A; i < B; i++)
				at[i] = 0;
		}
		else
		{
			max = A;
		}

	for (i = 0; i < max; i++)
	{
		ans[i] = ans[i] + at[i] + bt[i];
		if (ans[i] >= 10)
		{
			ans[i] = ans[i] - 10;
			ans[i + 1]++;
		}
	}
	for (i = max; i >= 0; i--)
		if (ans[i] > 0)
			break;
	if (i < 0)
		cout << '0' << endl;
	for(j = i; j >= 0; j--)
		cout << ans[j];
	cout << endl;
	return 0;
}
int main()
{   void jiafa(char a[] ,char b[] ,int c[]);
	char a[300],b[300];
	cin>>a>>b;
	int jieguo[300];
	memset(jieguo,0,sizeof(jieguo));
	jiafa(a,b,jieguo);
	int i=296;
	while(jieguo[i]==0&&i>0)
		i--;
	if(i==0)
		cout<<jieguo[0];
	else
		for( ;i>=0;i--)
			cout<<jieguo[i];
}

void jiafa(char a[],char b[],int c[])
{
	const int len=300;
	int an[len],bn[len];
	memset(an,0,sizeof(an));
	memset(bn,0,sizeof(bn));
	int lena=strlen(a);
	int lenb=strlen(b);
	int i=0;
	int j=0;
	for(i=lena-1;i>=0;i--)
		an[j++]=a[i]-'0';
	j=0;
	for(i=lenb-1;i>=0;i--)
		bn[j++]=b[i]-'0';
	for(i=0;i<len;i++)
	{
		an[i]+=bn[i];
		if(an[i]>9)
		{
			an[i]-=10;
			an[i+1]++;
		}
		c[i]=an[i];
	}
}
char a[270], b[270];

int MAX(int e1, int e2)
{
	if (e1 > e2) return e1;
	return e2;
}

int main()
{
	cin >> a >> b;
	

	char c[270];

	int len1 = strlen(a), len2 =strlen(b);
	int len = MAX(len1, len2);
	
	int ic = 0, ia, ib;
	int j1 = len1-1, j2 = len2-1, j3 = len -1;
	c[len] = 0;
	
	while (j1 >= 0 && j2 >= 0)
	{
		ia = a[j1] - '0';
		ib = b[j2] - '0';
		ic += ia + ib;
		c[j3] = ic % 10 + '0';
		ic /= 10;
		j1 --;
		j2 --;
		j3 --;
	}
	if (j2 > 0)
	{
		while (j2 >= 0)
		{
				ib = b[j2] - '0';
				ic += ib;
				c[j3] = ic % 10 + '0';
				ic /= 10;
				j2 --;
				j3 --;
		}
	}
	if (j1 > 0)
	{
		while (j1 >= 0 && ic > 0)
		{
				ia = a[j1] - '0';
				ic += ia;
				c[j3] = ic % 10 + '0';
				ic /= 10;
				j1 --;
				j3 --;
		}
	}
	if (ic > 0)
	{
		cout << ic << c;
	}
	else
	{
		int i;
		for ( i = 0;  i < strlen(c) - 1; i++)
		{
			if (c[i] == '0') continue;
			else break;
		}
		while (i < strlen(c))
		{
			cout << c[i];
			i++;
		}	
	}
	return 0;
	
}
int main()
{
    long m,n,l1,l2,i,j,p,o,l;  
    long long sum=0,k;
    char s1[500],s2[500];
    int a[500],b[500],c[1500];
    scanf("%s",s1);
    scanf("%s",s2);
    l1=strlen(s1);
    l2=strlen(s2);
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    memset(c,0,sizeof(c));
    for (i=0;i<l1;i++) a[l1-1-i]=s1[i]-48;
    for (i=0;i<l2;i++) b[l2-1-i]=s2[i]-48;
    if (l1>l2) l=l1;
    else l=l2;    
    for (i=0;i<l;i++)
    {
        c[i]+=a[i]+b[i];
        if (c[i]>=10)
        {
            c[i]=c[i]%10;
            c[i+1]++;
        }
    }               
    
    while ((c[l]==0)&&(l>1)) l--;
    if (c[l]>0) l++;
    for (i=l-1;i>=0;i--)printf("%d",c[i]);    
    
        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);
    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)
        {
            a1[i]=a1[i]-10;
            a1[i+1]++;
        }
    }
    j=290;
  while(a1[j]==0&&j>0) j--;
  for(;j>=0;j--)
    cout<<a1[j];
    return 0;
}
int main()
{
	char a[300],b[300];
	int c[300],aa[300],bb[300],i,la,lb,l;
	cin>>a;
	cin>>b;
	la=strlen(a);
	lb=strlen(b);
   memset(aa,0,sizeof(aa));
   memset(bb,0,sizeof(bb));
	for (i=0;i<la;i++)
	aa[i]=a[la-i-1]-'0';

	for (i=0;i<lb;i++)
	bb[i]=b[lb-i-1]-'0';

	l=la;if(lb>l) l=lb;
	memset(c,0,sizeof(c));
	for (i=0;i<l;i++)
	c[i]=aa[i]+bb[i];

	for (i=0;i<l;i++)
	if (c[i]>=10)
	{
		c[i]-=10;
		c[i+1]++;
	}
	if (c[l]>0) l++;
	while ((c[l-1]==0)&&(l>1)) l--;
	for (i=l-1;i>=0;i--)
	cout<<c[i];
}
// ?????
// ????wayne
// ?????12.30



int main()
{
	char a[250],b[250];
	int a1[250],b1[250],c[260],i,j=0,max;
	for(i=0;i<250;i++)
	{
		a1[i]=0;
		b1[i]=0;
		c[i]=0;
	}
	for(i=250;i<260;i++)
		c[i]=0;
	cin.getline(a,250);
	cin.getline(b,250);
	if(strlen(a)>=strlen(b))
		max=strlen(a);
	else
		max=strlen(b);
	for(i=strlen(a)-1,j=0;i>=0;i--,j++)
		a1[j]=a[i]-'0';
	for(i=strlen(b)-1,j=0;i>=0;i--,j++)
		b1[j]=b[i]-'0';
	for(i=0;i<max;i++)
	{
		c[i]+=a1[i]+b1[i];
		if(c[i]>=10)
		{
			c[i+1]++;
			c[i]-=10;
		}
	}
	while(c[i]==0&&i>0)
		i--;
	for(;i>=0;i--)
		cout<<c[i];
	cout<<endl;
	


	return 0;
}
void main() 
{ 
char x[300],y[300],z[300]; 
int Lx,Ly,Lz,L; 
int Lmax,Lmin; 
int i,j,k=0; 
scanf("%s",&x[0]); 
scanf("%s",&y[0]); 
if ((x[0]=='0')&&(x[1]=='0')) printf("1260010");
else
{
Lx = strlen(x); 
Ly = strlen(y); 
Lmax = Lx; Lmin=Lx; 
if (Ly > Lmax) Lmax=Ly; 
if (Ly < Lmin) Lmin=Ly; 
if (Lx < Lmax) 
{ 
for (i=Lx-1;i>=0;i--) x[i+Lmax-Lx] = x[i]; 
for (i=0;i<=Lmax -Lx-1;i++) x[i] = '0'; 
x[Lmax] = '\0'; 
} 

if (Ly < Lmax) 
{ 
for (i=Ly-1;i>=0;i--) y[i+Lmax-Ly] = y[i]; 
for (i=0;i<= Lmax-Ly-1;i++) y[i] = '0'; 
y[Lmax] = '\0'; 
} 
k = 0; 
for (i=Lmax-1;i>=0;i--)
{ 
z[i] = x[i] - '0' + y[i] + k; 
if (z[i] > '9') 
{ z[i] = z[i] - 10; k=1;} 
else {k = 0;}; 
} 
if (k == 1) printf("1"); 
for (i=0;i<Lmax;i++) printf("%c",z[i]); 
}
}
int main()
{   
	char num1[251],num2[251];
	int a[251],b[251],d[251],len1,len2,i=0,j=0;
	memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
	memset(d,0,sizeof(d));
    cin.getline (num1,251);
	cin.getline (num2,251);
	len1=strlen(num1);
	len2=strlen(num2);
	for(i=len1-1;i>=0;i--)
	{
		a[j++]=num1[i]-'0';
	}
	j=0;
    for(i=len2-1;i>=0;i--)
	{
		b[j++]=num2[i]-'0';
	}
    for(i=0;i<251;i++)
	{
		if(a[i]!=0 || b[i]!=0)break;
		if(i=250){cout<<"0";return 0;}
	}
	//for(i=0;i<len1;i++){cout<<a[i];}
	//cout<<endl;
	//for(i=0;i<len2;i++){cout<<b[i];}
    //cout<<endl;
	for(i=0;i<251;i++)
	{
		if((a[i]+b[i]+d[i])>=10)
		{
			d[i]=d[i]+a[i]+b[i]-10;
			d[i+1]=1;
		}
		else{d[i]=d[i]+a[i]+b[i];}
	}
	for(j=250;j>=0;j--)
	{
		if(d[j]!=0)break;
	}
	for(i=j;i>=0;i--)
	{cout<<d[i];}
	return 0;
}
/*
 * p.cpp
 *
 *  Created on: 2011-12-2
 *      Author: Administrator
 */
int main()
{
	char aa[300],bb[300];
	int a[300],b[300],c[300];
	cin.getline(aa,300);                //??aa?
	cin.getline(bb,300);                //??bb?

	int l1,l2,t=0,step=0,i;
	l1=strlen(aa);
	l2=strlen(bb);
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	for(i=0;i<l1;i++) a[l1-i-1]=aa[i]-'0';           //?aa?????????a?
	for(i=0;i<l2;i++) b[l2-i-1]=bb[i]-'0';           //?bb?????????b?
	while(step<l1 || step<l2){                       //??????
		c[step]=a[step]+b[step]+t;
		t=c[step]/10;
		c[step]=c[step]%10;
		step++;
	}
	if(t>0) c[step++]=t;           //????
	for(i=step-1;i>=0;i--) if(c[i]!=0 || i==0) break;       //????0
	for(;i>=0;i--) cout<<c[i];
	return 0;
}
int main ()
{
	char a[255],b[255];
	int m[255]={0},n[255]={0};
	int s1,s2;
	cin>>a;
	cin>>b;
	s1=0;
	for(int i=0;a[i]!='\0';i++)   s1++;
	for(int i=s1-1,j=0;i>-1;i--,j++)
	{
		m[j]=(int) ( a[i]-'0' );
	}
	s2=0;
	for(int i=0;b[i]!='\0';i++)   s2++;
	for(int i=s2-1,j=0;i>-1;i--,j++)
	{
		n[j]=(int) ( b[i]-'0' );
	}
	if(s1<s2) s1=s2;
	for(int i=0;i<s1;i++) 
	{
			m[i]=m[i]+n[i];
			if(m[i]>=10) 
			{
				m[i]=m[i]-10;
				m[i+1]++;
			}
	}
	s2=0;
	int i=s1;
        while(m[i--]==0&&s2<s1)  s2++;
	for(int i=s1-s2;i>-1;i--) cout <<m[i];
	cout<<endl;
	return 0;
}
int main()
{
	char a[2000]={0};
	char b[2000]={0};
	char c[3000]={0};
	scanf("%s",a);
	scanf("%s",b);
	int len1=strlen(a);
	int len2=strlen(b);
	if(len1<len2)
		{
		strcpy(c,a);
		strcpy(a,b);
		strcpy(b,c);	
		}
	len1=strlen(a);
	len2=strlen(b);
	memset(c,0,(len1+1)*sizeof(int));
	for(int i=0;i<len1-len2;i++)
		c[i]=a[i]-'0';
	for(int i=0;i<len2;i++)
		c[i+len1-len2]=a[i+len1-len2]+b[i]-'0'-'0';	
	int add=0;
	for(int i=len1-1;i>=0;i--)
		{
		c[i]+=add;
		add=c[i]/10;
		c[i]=c[i]%10;	
		}
	int judge=0,judge1=0;
	if(add!=0)
		{
		printf("%d",add);
		judge=1;
		judge1=1;	
		}
	for(int i=0;i<len1;i++)
		{
		if(judge!=0)
			{
			printf("%d",c[i]);
			judge1=1;	
			}
		else
			{
			if(c[i]!=0)
				{
				printf("%d",c[i]);	
				judge=1;	
				judge1=1;
				}
			}	
		}
	if(judge1==0)
		printf("%d",c[0]);
}
int main()
{

	char up[300]={NULL};
	char down[300]={NULL};
	int add1[300]={0};
	int add2[300]={0};
	int result[300]={0};
	int uplen=0, downlen=0;

	cin>>up>>down;

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


	temp=strlen(down);
	for(int i=0; i<temp; i++)
	{
		
		add2[i]=down[downlen-1]-'0';
		//cout<<add2[i];
		
		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 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)
	cout<<0;
	
	}

return 0;

}
int main()
{
	char x[251], y[251];
	int i, j, array[251];
	for (i = 0; i < 251; i ++)
		array[i] = 0;
	cin >> x >> y;
	if (x[0] == '0' && y[0] == '0' && strlen(x) == 1 && strlen(y) == 1)
		cout << 0;
	for (i = 0; i < strlen(x) && i < strlen(y); i ++)
	{
		array[i] = array[i] + x[strlen(x) - i - 1] + y[strlen(y) - i - 1] -2 * '0';
		if (array[i] > 9)
		{
			array[i + 1] ++;
			array[i] = array[i] - 10;
		}
	}
	if (strlen(x) >= strlen(y))
		for (j = i; j < strlen(x); j ++)
		{
			array[j] = array[j] + x[strlen(x)- j - 1] - '0';
			if (array[j] > 9)
			{
				array[j + 1] ++;
				array[j] = array[j] - 10;
			}
		}
	else
        for (j = i; j < strlen(y); j ++)
		{
			array[j] = array[j] + y[strlen(y)- j - 1] - '0';
			if (array[j] > 9)
			{
				array[j + 1] ++;
				array[j] = array[j] - 10;
			}
		}
	for (i = 250; array[i] == 0; i --){}
	for (j = i; j >= 0; j --)
		cout << array[j];
	cout << endl;
	return 0;
}
int main()
{
    char a[250],b[250];
    gets(a);gets(b);
    int c[300]={0};
    int l1,l2,max;
    int flag=0;
    l1=strlen(a);
    l2=strlen(b);
    if (l1>l2) max=l1;
    else max=l2;
    int i;
    for(i=0;i<max;i++)
    {
        if(i<l1&&i<l2)
        {
            c[i+1]+=(c[i]+a[l1-1-i]+b[l2-1-i]-2*'0')/10;
            c[i]=(c[i]+a[l1-1-i]+b[l2-1-i]-2*'0')%10;
        }
        else if(i<l1&&i>=l2)
        {
            c[i+1]+=(c[i]+a[l1-1-i]-'0')/10;
            c[i]=(c[i]+a[l1-1-i]-'0')%10;
        }
        else if(i<l2&&i>=l1)
        {
            c[i+1]+=(c[i]+b[l2-1-i]-'0')/10;
            c[i]=(c[i]+b[l2-1-i]-'0')%10;
        }
    }
    for(i=max;i>=0;i--)
    {
        if(i==0&&flag==0)
        printf("%d",c[i]);
        if(c[i]==0&&flag==0)
        continue;
        printf("%d",c[i]);
        flag=1;
    }
    return 0;
}
int main()
{
	char a[300],b[300],c[300],x;
	int n1,n2,m,i,t=-1,z=0;
	scanf("%s%s",a,b);
	n1=strlen(a);
	n2=strlen(b);
	if(n1<=n2)
	{
		m=n2;
	    for(i=1;i<=n1;i++)
		{
			x=a[n1-i]+b[n2-i]-48+z;
			if(x>57)
			{
				c[m-i]=x-10;
				z=1;
			}
			else
			{
				c[m-i]=x;
				z=0;
			}
		}
		for(i=n1+1;i<=n2;i++)
		{
			x=b[n2-i]+z;
			if(x>57)
			{
				c[m-i]=x-10;
				z=1;
			}
			else
			{
				c[m-i]=x;
				z=0;
			}
		}
        c[m]='\0';
	}
	else 
     {
		m=n1;
	    for(i=1;i<=n2;i++)
		{
			x=a[n1-i]+b[n2-i]-48+z;
			if(x>57)
			{
				c[m-i]=x-10;
				z=1;
			}
			else
			{
				c[m-i]=x;
				z=0;
			}
		}
		for(i=n2+1;i<=n1;i++)
		{
			x=a[n1-i]+z;
			if(x>57)
			{
				c[m-i]=x-10;
				z=1;
			}
			else
			{
				c[m-i]=x;
				z=0;
			}
		}
        c[m]='\0';
	}
	
	if(z==1)
	{
		printf("1");
	    printf("%s\n",c);
	}
	else 
	{
		for(i=0;i<m;i++)
		{
			if(c[i]!='0')
			{
				t=i;
			    break;
			}
		}
		if(t!=-1)
		{
		    for(i=t;i<m;i++)
			    printf("%c",c[i]);
		    printf("\n");
		}
		else printf("0\n");
	}
	
	return 0;
}
int  main()
{
     char str1[405],str2[405];
     cin>>str1>>str2; 
     int x=strlen(str1),y=strlen(str2);
     int maxlen=x>y?x:y;
     int ans1[405],ans2[405],i,j=0;
     memset(ans1,0,sizeof(ans1));
     memset(ans2,0,sizeof(ans2));
     for (i=x-1;i>=0;i--)
     ans1[j++]=str1[i]-'0';
     j=0;
     for (i=y-1;i>=0;i--)
     ans2[j++]=str2[i]-'0';
     for (i=0;i<maxlen;i++)
     {
         ans1[i]+=ans2[i];
         if (ans1[i]>=10){
         ans1[i]-=10;
         ans1[i+1]++;}
     }
     i=maxlen;
     while(ans1[i]==0) i--;
     if (i<0)
     cout<<0;
     else{
     for (;i>=0;i--)
     cout<<ans1[i];
     }
     return 0;
}
int main()
{
	char a[260]={0},b[260]={0},c[260]={0};
	cin.getline(a,255);
	cin.getline(b,255);
	int a1[260]={0},b1[260]={0},c1[260]={0},i=0,na,nb;
	while(a[++i]!=0&&i<255)
		;
	na=i;
	while(i-->0)
		a1[251-na+i]=a[i]-'0';
	while(b[++i]!=0&&i<255)
		;
	nb=i;
	while(i-->0)
		b1[251-nb+i]=b[i]-'0';
	for(i=250;i>0;i--)
	{
		c1[i]+=a1[i]+b1[i];
		if(c1[i]>9)
		{
			c1[i-1]=c1[i]/10;
			c1[i]=c1[i]%10;
		}
	}
	for(i=0;c1[i]==0&&i<255;i++)
		;
	if(i==255)
		cout<<"0";
	for(;i<251;i++)
		cout<<c1[i];
	return 0;
}
int main()
{
    char a[250],b[250],c[250],d[250],e[250];
    gets(a);
    gets(b);
    int i;
    for(i=strlen(a)-1;i>=0;i--)
    c[strlen(a)-1-i]=a[i]-'0';
    for(i=strlen(b)-1;i>=0;i--)
    d[strlen(b)-1-i]=b[i]-'0';
    int big,sma;
    big=strlen(a)>=strlen(b)?strlen(a):strlen(b);
    sma=strlen(a)<=strlen(b)?strlen(a):strlen(b);
    e[0]=(c[0]+d[0]);
    for(i=1;i<=big-1;i++)
    if(i<=sma-1)
    e[i]=(c[i]+d[i]+e[i-1]/10);
    else
    {
        if(strlen(a)>=strlen(b))
        e[i]=(c[i]+e[i-1]/10);
        else
        e[i]=(d[i]+e[i-1]/10);
    }
    if(e[big-1]!=0||big==1)
    printf("%d",e[big-1]);
    for(i=big-2;i>=0;i--)
    printf("%d",e[i]%10);
}
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-1]-'0'):0;
		b=(l2>0)?(s2[l2-1]-'0'):0;
		c[l]+=a+b;
		c[l+1]=c[l]/10;
		c[l]%=10;
		l1--;
		l2--;
		l++;
	}
	while(c[l]==0&&l>0)
	{
		l--;
	}
	int i;
	for(i=l;i>=0;i--)
	{
		printf("%d",c[i]);
	}
	return 0;
}
void plus(char* a,char* b,char* c)
{
	char temp;
	int lena,lenb,i,j,k;
	lena=strlen(a);
    lenb=strlen(b);	
	for(i=0;i<lena&&i<lenb;i++)
	{
		c[i]+=a[lena-1-i]+b[lenb-1-i]-'0';
		if(c[i]>'9')
		{
			c[i+1]++;
			c[i]-=10;
		}
	}
	if(lena>lenb)
	{
		for(i=lenb;i<lena;i++)
		{c[i]+=a[lena-1-i];
		if(c[i]>'9')
		{
			c[i+1]++;
			c[i]-=10;
		}}
	}
	else if(lena<lenb)
	{
		for(i=lena;i<lenb;i++)
		{c[i]+=b[lenb-1-i];
		if(c[i]>'9')
		{
			c[i+1]++;
			c[i]-=10;
		}}
	}
	c[i]+='0';
	while(c[i]=='0'&&i>0)
	i--;
    c[i+1]='\0';
	for(j=0,k=i;j<k;j++,k--)
	{
	   temp=c[k];
	   c[k]=c[j];
	   c[j]=temp;	
	}
}
int main()
{
	char a[N],b[N],c[N];
	scanf("%s",a);
	scanf("%s",b);
	memset(c,0,sizeof(c));
	plus(a,b,c);
	printf("%s",c);
}
int main()
{   
	char str1[1000],str2[1000];
	cin>>str1>>str2;
	if((atoi(str1)==0)&&(atoi(str2)==0))
	{
		cout<<0;
		return 0;
	}
	int l1,l2;
	l1=strlen(str1);
	l2=strlen(str2);
	int num1[1000];
	memset(num1,0,sizeof(num1));
	int num2[1000];
	memset(num2,0,sizeof(num2));
	int i;
    for(i=0;i<l1;i++)
    {
    	num1[i]=str1[l1-1-i]-'0';
    }
    for(i=0;i<l2;i++)
    {
    	num2[i]=str2[l2-1-i]-'0';
    }
    int num[1000];
    memset(num,0,sizeof(num));
    int l;
    if(l1>=l2)
    {    l=l1;
    	 for(i=0;i<l1;i++)
    	 {
    	   	
    	   	num[i]=num1[i]+num2[i];
    	 }
    }
    else
    {   
	    l=l2;
    	for(i=0;i<l2;i++)
    	 {
    	   	
    	   	num[i]=num1[i]+num2[i];
    	 }
    }
    for(i=0;i<=l;i++)
    {
    	
    	if(num[i]>=10)
    	{
    	 num[i+1]=num[i+1]+num[i]/10;
    	 num[i]=num[i]%10;
        }
    }
    int p=0;
    for(i=0;i<=l;i++)
    { 
      if(num[l-i]>0)
      p=1;
      if(p>0)
      cout<<num[l-i];	
    }
    return 0;
}
int main()
{
	char a[250];
	char b[250];
	scanf("%s",a);
	scanf("%s",b);
	int i = 0;
	int j = 0;
	while ( a[i] != '\0' )
	{
		i++;
	}
	while ( b[j] != '\0' )
	{
		j++;
	}
	int d;
	int k;
	if ( i - j > 0 )
	{
		d = i - j;
		for ( k = i ; k	>= i - j ; k-- )
		{
			b[k] = b[k-d];
		}
		for ( k = 0 ; k < i - j ; k++ )
		{
			b[k] = '0';
		}
	}
	else
	{
		d = j - i;
		for ( k = j ; k	>= j - i ; k-- )
		{
			a[k] = a[k-d];
		}
		for ( k = 0 ; k < j - i ; k++ )
		{
			a[k] = '0';
		}
	}
	int max;
	if ( i > j )
	{
		max = i;
	}
	else
	{
		max = j;
	}
	char c[251];
	c[max+1] = '\0';
	c[0] = '0';
	for ( k = max - 1 ; k >= 0 ; k-- )
	{
		c[k+1] = a[k] + b[k] - 48;
		if ( c[k+1] > '9' )
		{
			c[k+1] -= 10;
			if ( k != 0 )
			{
				a[k-1] += 1;
			}
			else
			{
				c[0] = '1';
			}
		}
	}
	//printf("%s\n",c);
	int count = 0;
	for ( k = 0 ; k <= max ; k++ )
	{
		if ( c[k] != '0' && count == 0 )
		{
			printf("%c",c[k]);
			count++;
			continue;
		}
		if ( count != 0 )
		{
			printf("%c",c[k]);
		}
		//printf("%d\n",k);
	}
	printf("\n");
	return 0;
}
main()
{
      char a[250]={'0'},b[250]={'0'};
      scanf("%s",a);
      scanf("%s",b);
      int la,lb,l,c[251]={0},x=0,sum;
      la=strlen(a);
      lb=strlen(b);
      l=la;
      if(la>lb)
      {        
               for(int i=0;i<=lb;i++)
               {
               b[la-i]=b[lb-i];
               }
               for(int i=0;i<la-lb;i++)
               b[i]='0';
               
      }
      if(la<lb)
      {        
               for(int i=0;i<=la;i++)
               {
               a[lb-i]=a[la-i];
               }
               for(int i=0;i<lb-la;i++)
               a[i]='0';
               l=lb;
      }
      for(int i=l;i>0;i--)
      {
              sum=a[i-1]+b[i-1]-'0'-'0'+x;
              c[i]=sum%10;
              x=sum/10; 
      }
      c[0]=x;
      for(int i=0;i<l;i++)
      {
              if(c[i]!=0)
              {
                         
                         for (int j=i;j<l;j++)
                         printf("%d",c[j]);
                         break;
              }
      }
      printf("%d",c[l]);
      }
int main(int argc, char* argv[])
{
	char s1[256],s2[256];
	int c[256]={0};
	int a,b,i,l1,l2,l=0;
	scanf("%s%s",s1,s2);
	l1=(int)strlen(s1);
    l2=(int)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++]%=10;
	}
	while(c[l]==0&&l>0)
		l--;
	for(i=l;i>=0;i--)
		printf("%d",c[i]);
	return 0;
	}