semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[251],b[251];
	cin.getline(a,251);
	cin.getline(b,251);
	int a1[251],b2[251];
	memset(a1,0,sizeof(a1));
	memset(b2,0,sizeof(b2));
	for( int i = 0; i <= strlen( a ) - 1; i ++)
	{
		a1[i]=a[strlen(a)-i-1]-'0';
	}
	
	for(int i = 0; i <= strlen( b) - 1; i ++ )
	{
		b2[i]=b[strlen(b)-1-i]-'0';
	}
	
	for(int i=0;i<250;i++)
	{
		b2[i+1]+=(a1[i]+b2[i])/10;
		b2[i]=(a1[i]+b2[i])%10;
	}
	
	int k;
	for(k=249;k>=0;k--)	if(b2[k]!=0) break;
	for(int j=k;j>=0;j--) cout<<b2[j];
	if(k==-1) cout<<"0";
	cout<<endl;
	return 0;
}
void main()
{
	int i,j,k,a[201]={0},b[200]={0},len,flag=0;
	char str1[201],str2[201];

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

	if(strlen(str1)==1&&strlen(str2)==1&&str1[0]=='0'&&str2[0]=='0')
		printf("0\n");
	else{

	for(i=0;i<strlen(str1);i++)
		a[strlen(str1)-i-1]=str1[i]-'0';
	for(j=0;j<strlen(str2);j++)
		b[strlen(str2)-j-1]=str2[j]-'0';

	len=(strlen(str1)>strlen(str2))?strlen(str1):strlen(str2);

	for(i=0;i<len;i++){
		a[i]+=b[i];
	if(a[i]>=10){
		a[i]-=10;
		a[i+1]++;
	}
	}
	
	for(k=len;k>=0;k--){
		if(flag)
			printf("%d",a[k]);
		else if(a[k]){
			printf("%d",a[k]);
			flag=1;
		}
	}
	printf("\n");
}
}
int main()
{
	char a[250],b[250];
	int X[251]={0},Y[250]={0};
	cin>>a>>b;
	int l1=strlen(a),l2=strlen(b);
	int i,k=0;
	for(i=l1-1;i>=0;i--)
		X[k++]=a[i]-'0';
	k=0;
	for(i=l2-1;i>=0;i--)
		Y[k++]=b[i]-'0';

	if(l1>=l2)
		k=l1;
	else
		k=l2;

	for(i=0;i<k;i++)
	{
		X[i] += Y[i];
		if(X[i]>=10)
		{
			X[i+1] += 1;
			X[i] %= 10;
		}
	}
	i=k;
	while(i>0)
	{
		if(X[i]!=0)
			break;
		i--;
	}
	for(;i>=0;i--)
		cout<<X[i];
	cout<<endl;
	return 0;
}
int main(){
	char a[255],b[255],c[255];
	int i,j,d,e,f;
	scanf("%s",a);
	scanf("%s",b);
	f=strlen(a);
	for(i=0;i<=f;i++){
		a[254-i]=a[f-i];
	}
	for(i=0;i<=253-f;i++){
		a[i]='0';
	}
	f=strlen(b);
	for(i=0;i<=f;i++){
		b[254-i]=b[f-i];
	}
	for(i=0;i<=253-f;i++){
		b[i]='0';
	}
	f=0;
	for(i=253;i>=0;i--){
		d=a[i]-'0'+b[i]-'0'+f;
		e=d%10;
		f=d/10;
		c[i]=e+'0';
	}
	c[254]=0;
	for(i=0;c[i]=='0';){
		for(j=0;j<254;j++){
			c[j]=c[j+1];
		}
	}
	if(strlen(c)==0) printf("0");
	else printf("%s",c);
	scanf("%d",&i);
	return 0;
}
int main()
{
	char num1[301]={0},num2[301]={0};
	cin>>num1>>num2;
	int n1=strlen(num1),n2=strlen(num2);

	for(int k=0;k<=(n1-1)/2;k++)
		swap(num1[k],num1[n1-1-k]);
	for(int k=0;k<=(n2-1)/2;k++)
		swap(num2[k],num2[n2-1-k]);
	
	int num[310]={0};

	for(int k=0;k!=301;k++)
	{
		if(num1[k]>='0'&&num1[k]<='9')
			num1[k]-='0';
		if(num2[k]>='0'&&num2[k]<='9')
			num2[k]-='0';
	}

	for(int k=0;k!=301;k++)
	{
		num[k]=num[k]+num1[k]+num2[k];
		if(num[k]>=10)
		{
			num[k]-=10;
			num[k+1]+=1;
		}
	}
	int k;
	for(k=301;k>=0;k--)
	{
		if(num[k]!=0)
			break;
	}
	if(k==-1)
		cout<<'0';
	for(int i=k;i>=0;i--)
		cout<<num[i];
	cout<<endl;
	return 0;
}
int change(char a)
{
    int b;
    switch(a)
    {
     case'0':b=0;break;
     case'1':b=1;break;
     case'2':b=2;break;
     case'3':b=3;break;
     case'4':b=4;break;
     case'5':b=5;break;
     case'6':b=6;break;
     case'7':b=7;break;
     case'8':b=8;break;
     case'9':b=9;break;
     }
     return(b);
  }

int main()
{
     char a[251],b[251];
	 int c[300];
	 int *p=c;
     int i;
     gets(a);
     gets(b);
     int x,y;
     x=strlen(a);
	 y=strlen(b);
	 int d,max,s=0;
     if(x>=y)
	 {max=x;}
	 else
     {max=y;}
	 d=change(a[x-1])+change(b[y-1]);
     for(i=max;i>0;i--)
     {
		 x--;
		 y--;
		 if(d>=10)
		 {
			 *p=d-10;	        
			 s++;
		     if((x-1)>=0&&(y-1)>=0)
			 {d=change(a[x-1])+change(b[y-1])+1;}
		     else if((x-1)>=0&&(y-1)<0)
			 {d=change(a[x-1])+1;}
			 else if((y-1)>=0&&(x-1)<0)
		     {d=change(b[y-1])+1;}
			 else if((y-1)<0&&(x-1)<0)
			 {*(p+1)=1;s++;}
		 }
		 else if(d<10)
		 {
			 *p=d;
			 s++;
		     if((x-1)>=0&&(y-1)>=0)
			 {d=change(a[x-1])+change(b[y-1]);}
		     else if((x-1)>=0&&(y-1)<0)
			 {d=change(a[x-1]);}
			 else if((y-1)>=0&&(x-1)<0)
		     {d=change(b[y-1]);}
			 else if((y-1)<0&&(x-1)<0)
			 {break;}
		 }
		 p++;
	 }
	 int m;
  for(i=s-1;i>=0;i--)
  { 
	  if(c[i]!=0)
	  {m=i;break;}
  }
  for(i=m;i>=0;i--)
  {	  printf("%d",c[i]);}
	return 0;
}
int f(int *an1,int *an2);
int an1[211],an2[211],nHighestPos = 0;
char num1[211],num2[211];
int main()
{
    int i,j,len1,len2;
	memset(an1,sizeof(an1),0);
	memset(an2,sizeof(an2),0);
	cin>>num1>>num2;
	len1=strlen(num1);
	len2=strlen(num2);
	for(j=0,i=len1-1;i>=0;i--)
	{
	    an1[j++]=num1[i]-'0';
	}
	for(j=0,i=len2-1;i>=0;i--)
	{
	    an2[j++]=num2[i]-'0';
	}
	nHighestPos = f(an1,an2);
	for(i=nHighestPos;i>=0;i--)
		cout<<an1[i];
	return 0;
}
int f(int *an1,int *an2)
{
    int i;
	for(i=0;i<201;i++)
	{
	    an1[i]=an1[i]+an2[i];
		if(an1[i]>=10)
		{
		    an1[i]=an1[i]-10;
			an1[i+1]++;
		}
		if(an1[i])
			nHighestPos = i;
	}
	return nHighestPos;
}
void add()
{
	char a[255],b[255];
	int ua[255]={0},ub[255]={0},sum[255]={0};
	cin>>a>>b;
	int lena,lenb;
	lena=strlen(a),lenb=strlen(b);
	for (int i=0;i<lena;i++)
	{ua[i]=a[lena-1-i]-48;}//cout<<ua[i];}
//	cout<<endl;
	for (int i=0;i<lenb;i++)
	{ub[i]=b[lenb-1-i]-48;}//cout<<ub[i];}
//	cout<<endl;
	int max;
	if (lena>lenb) max=lena;
	else max=lenb;
	int temp;
	for (int i=0;i<max+1;i++)
	{
		temp=ua[i]+ub[i];
		ua[i+1]+=temp/10;
		sum[i]=temp%10;
//		cout<<temp<<endl;
	}
	int mark=0;
	for (int i=254;i>=0;i--)
	{
		if (sum[i]!=0)
		mark=1;
		if (mark==1)
		cout<<sum[i];
	}
	if (mark==0) cout<<"0";
	cout<<endl;
}

int main()
{
//	int n;
//	cin>>n;
//	for (int i=0;i<n;i++)
	add();
}
int Max(int X,int Y)
{
	return X > Y ? X : Y;
}
int main()
{
	char A[260],B[260];
	int C[260];
	gets(A);
	gets(B);
	int N = strlen(A);
	int M = strlen(B);
	int S = Max(N,M);
	memset(C,0,sizeof(C));
	for (int I = 0; I < N; I ++) C[I] = A[N - I - 1] - '0';
	for (int I = 0; I < M; I ++) C[I] = C[I] + B[M - I -1] - '0';
	for (int I = 0; I < S; I ++)
		if (C[I] >= 10)
		{
			C[I] = C[I] - 10;C[I + 1] ++;
		}
	while (C[S] == 0 && S >= 0) S --;
	for (int I = S; I >= 0; I --) cout << C[I];
	if (S<0) cout << 0;
}
void main()
{
	char s1[250],s2[250];
	int a[250],b[250],c[250]; 
	int i,j,len1,len2,max;
	for(i=0;i<250;i++)
	{
		a[i]=0;
		b[i]=0;
		c[i]=0;
	}

	scanf("%s %s",s1,s2);
	len1=strlen(s1);
	len2=strlen(s2);
	for(i=0;i<len1;i++)
		a[len1-i-1]=s1[i]-'0';
	for(i=0;i<len2;i++)
		b[len2-i-1]=s2[i]-'0';
	if(a[0]==0&&b[0]==0&&len1==1&&len2==1)
		printf("0");
	else
	{
	for(i=0;i<len1||i<len2;i++)
	{
		if(a[i]+b[i]+c[i]<10) c[i]=a[i]+b[i]+c[i];
		else
		{
			c[i]=a[i]+b[i]+c[i]-10;
			c[i+1]=c[i+1]+1;
		}
	}

	if(len1>len2) max=len1;
	else max=len2;

	for(i=max;i>=0;i--)
	{
		if(c[i]!=0) break;
	}

	for(j=i;j>=0;j--)
		printf("%d",c[j]);
	printf("\n");
	}
}
main()
{
      char str1[251],str2[251],str[289];
      int i,m,n,z,x,t,l=0;
      for(i=0;i<=251;i++)
      str[i]='\0';
      gets(str1);
      gets(str2);
      m=strlen(str1);
      n=strlen(str2);
      z=0;

      if (m<n) 
      {
               for (i=n-1;i>=n-m;i--)
               {
               x=str1[i-n+m]+str2[i]-'0'-'0'+z;
               if (x<10) str[i+1]=x+'0',z=0;
               else str[i+1]=x-10+'0',z=1;
               }
               for (i=n-m-1;i>=0;i--)
               {
                    x=str2[i]+z-'0';
                    if(x<10) str[i+1]=x+'0',z=0;
                    else str[i+1]=x-10+'0',z=1;               
               }
               if(z==1) str[0]='1';
               else str[0]='0';
               }
      else if (m>=n) 
      {
               for (i=m-1;i>=m-n;i--)
               {
               x=str2[i-m+n]+str1[i]-'0'-'0'+z;
               if (x<10) str[i+1]=x+'0',z=0;
               else str[i+1]=x-10+'0',z=1;
               }
               for (i=m-n-1;i>=0;i--)
               {
                    x=str1[i]+z-'0';
                    if(x<10) str[i+1]=x+'0',z=0;
                    else str[i+1]=x-10+'0',z=1;               
               }
               if(z==1) str[0]='1';
               else str[0]='0';
               }

      t=strlen(str);
      for (i=0;i<=t-1;i++)
      {
           if(str[i]!='0') break;
           else l++;
           }
      if (l!=0&&l!=t)
      {
      for(i=0;i<=t;i++) str[i]=str[i+l];
      }
      else if(l==t) str[0]='0',str[1]='\0';
      printf("%s",str);

}
int main()
{
	int i,x,y,z,c[252],r=0,s=0;
	char a[251],b[251],d[251],e[251];
	cin>>d>>e;
	for(i=0;i<251;i++)
		c[i]=0;
	x=strlen(d);
	y=strlen(e);
	for(i=0;i<x;i++)
		a[i]=d[x-1-i];
	for(i=0;i<y;i++)
		b[i]=e[y-1-i];
	for(i=0;i<x;i++)
		if(a[i]!='0')
		{
			r=1;
			break;
		}
	for(i=0;i<y;i++)
		if(b[i]!='0')
		{
			s=1;
			break;
		}
	if(r==0&&s==0)
		cout<<"0"<<endl;
	else
	{
		if(x>y)
		{
			for(i=y;i<x;i++)
				b[i]='0';
			for(i=0;i<x;i++)
			{
				c[i]+=(int)a[i]-48+(int)b[i]-48;
				if(c[i]>=10)
				{
					c[i]+=-10;
					c[i+1]++;
				}
			}
			for(i=x+1;;i--)
				if(c[i]!=0)
				{
					z=i;
					break;
				}
			cout<<c[z];
			for(i=0;i<z;i++)
				cout<<c[z-1-i];
			cout<<endl;
		}
		else
		{
			for(i=x;i<y;i++)
				a[i]='0';
			for(i=0;i<y;i++)
			{
				c[i]+=(int)a[i]-48+(int)b[i]-48;
				if(c[i]>=10)
				{
					c[i]+=-10;
					c[i+1]++;
				}
			}
			for(i=y+1;;i--)
				if(c[i]!=0)
				{
					z=i;
					break;
				}
			cout<<c[z];
			for(i=0;i<z;i++)
				cout<<c[z-1-i];
			cout<<endl;
		}
	}
	return 0;
}
int main(){
	int a[251] = {0};
	int b[251] = {0};
	char sa[251];
	char sb[251];
	cin.getline(sa, 251);
	cin.getline(sb, 251);
	int len1 = strlen(sa);
	for(int i = 0; i < len1; i++)
		a[250-i] = sa[len1-i-1] - '0';
	int len2 = strlen(sb);
	for(int i = 0; i < len2; i++)
		b[250-i] = sb[len2-i-1] - '0';
	for(int i = 250; i> 0; i--)
	{
		a[i]+=b[i];
		if(a[i] >= 10)
		{
			a[i]-=10;
			a[i-1] += 1;
		}
	}
	int flag = 0;
	for(int i = 0; i < 251; i++)
	{
		if(a[i] != 0)
			flag = 1;
		if(flag)
			cout << a[i];
	}
	if(flag == 0)
		cout << 0;
	cout << endl;
}
int main()
{
	const int maxlen = 202;
	char szline1[maxlen];
	char szline2[maxlen];
	int an1[maxlen];
	int an2[maxlen];
	cin.getline(szline1, maxlen);
	cin.getline(szline2, maxlen);
	int len1 = strlen(szline1);
	int len2 = strlen(szline2);
	memset(an1, 0, sizeof (an1));
	memset(an2, 0, sizeof(an2));
	for (int i = len1 - 1, j = 0; i >= 0; i --)
		an1[j ++] = szline1[i] - '0';
	for (int i = len2 - 1, j = 0; i >= 0; i --)
		an2[j ++] = szline2[i] - '0';
	int begin;
	for (int i = 0; i < maxlen; i ++)
	{
		an1[i] += an2[i];
		if (an1[i] >= 10)
		{
			an1[i] -= 10;
			an1[i + 1] ++;
		}
		if (an1[i])
			begin = i;
	}
	for (int i = begin; i >= 0; i --)
		cout << an1[i];
	cout << endl;
	return 0;
}
char a1[252] , b1[252];
int a[252] , b[252] , la , lb , l;

int main ()
{
   gets (a1); gets (b1);
   la = strlen (a1) , lb = strlen (b1) , l = la > lb ? la : lb;
   int i;
   for ( i = 0 ; i < la ; i ++ )
    a[la-i-1] = a1[i] - '0';
   for ( i = 0 ; i < lb ; i ++ )
    b[lb-i-1] = b1[i] - '0';
   for ( i = 0 ; i < l ; i ++ )
    a[i] += b[i] , a[i+1] += a[i] / 10 , a[i] %= 10;
   for ( ; a[l] == 0 && l >= 0 ; l -- );
   l ++;
   if ( l <= 0 )  l = 1;
   for ( i = l-1 ; i >= 0 ; i -- )
    printf ( "%d" , a[i] );
  // getchar (); getchar ();
   return 0;
}
int add(int maxlen,int *num1,int *num2);
char a[251],b[251];
int num1[251],num2[251],maxlen,len1,len2,highestpos;
int main()
{
   int i,j;
   cin>>a>>b;
   len1=strlen(a);
   len2=strlen(b);
   memset(num1,0,sizeof(num1));
   memset(num2,0,sizeof(num2));
   maxlen=(len1>len2)? len1:len2;
   for(i=len1-1,j=0;i>=0;i--,j++)
	   num1[i]=a[j]-'0';
   for(i=len2-1,j=0;i>=0;i--,j++)
	   num2[i]=b[j]-'0';
   highestpos=add( maxlen, num1, num2);
   for(i=highestpos;i>=0;i--)
	   cout<<num1[i];
   return 0;
}
int add(int maxlen,int *num1,int *num2)
{
   int i;
   highestpos=0;
   for(i=0;i<=maxlen;i++)
   {
      num1[i]=num1[i]+num2[i];
	  if(num1[i]>=10) 
	  {
		  num1[i]=num1[i]-10;
		  num1[i+1]++;
	  }
	  if(num1[i]) highestpos=i;
   }
   return highestpos;
}
int main()
{
	unsigned str_1[250],str_2[250];
	char str_a[251],str_b[251];
	int len_a,len_b;
	cin.getline(str_a,251);
	cin.getline(str_b,251);
	len_a=strlen(str_a);
	len_b=strlen(str_b);
	memset(str_1,0,sizeof(str_1));
	memset(str_2,0,sizeof(str_2));
	int i,j=0;
	for(i=len_a-1;i>=0;i--)
		str_1[j++]=str_a[i]-'0';
	j=0;
	for(i=len_b-1;i>=0;i--)
		str_2[j++]=str_b[i]-'0';
	for(i=0;i<250;i++)
	{
		str_1[i]+=str_2[i];
		if(str_1[i]>=10)
		{
			str_1[i+1]++;
			str_1[i]-=10;
		}
	}
	for(i=249;i>=0;i--)
		if(str_1[i]!=0)
			break;
	if(i==-1)
		cout<<0;
	else
		for(;i>=0;i--)
			cout<<str_1[i];
	cout<<endl;
	return 0;
}
int main()
{
    char num1[252] = {0};
	char num2[252] = {0};
	char num3[253] = {0};
	cin>>num1>>num2;

    int maxLength;
	int num1Length = strlen(num1);
	int num2Length = strlen(num2);
    int i;

	if(num1Length >= num2Length)
		maxLength = num1Length;
	else
		maxLength = num2Length;
    
	int mark = 0;
	for(i = 0;i < maxLength || mark == 1;i++)
	{
		int a = 0;
		int b = 0;
		if(i < num1Length)
		   a = num1[num1Length -i - 1] - '0';
		if(i < num2Length)
			b = num2[num2Length -i - 1] - '0';
		int sum = a + b;
		if(mark == 1)
			sum++;
		if(sum >= 10)
		{
			sum -= 10;
			mark = 1;
		}
		else
			mark = 0;
		num3[i] = sum + '0';
	}
	int begin = maxLength;
	for(i = begin;i > 0;i--)
		if(num3[i] >= '1' && num3[i] <= '9')
			break;
		else
			begin--;

	for(i = begin;i >= 0;i--)
		cout<<num3[i];
	cout<<endl;

	
	return 0;
}
int main ()
{
	int i,d,e,f,g,h=0,k=-1;
	char a[255],b[255],c[255],z;
	for (i=0;i<255;i++)
	{
		a[i]='a';
		b[i]='a';
		c[i]='a';
	}
	scanf("%s\n%s",a,b);
	d=strlen(a);
	for(i=0;i<d/2;i++)
	{
		z=a[i];
		a[i]=a[d-1-i];
		a[d-1-i]=z;
	}
	e=strlen(b);
	for(i=0;i<e/2;i++)
	{
		z=b[i];
		b[i]=b[e-1-i];
		b[e-1-i]=z;
	}
	if (d<e)
		f=e;
	else
		f=d;
	for (i=0;i<f;i++)
	{
		if(a[i]=='a'||a[i]=='\0')
			a[i]=48;
		if(b[i]=='a'||b[i]=='\0')
			b[i]=48;
		g=a[i]-48+b[i]-48+h;
		if (g>=10)
		{
			c[i]=g-10+48;
			h=1;
		}
		else
		{
			c[i]=g+48;
			h=0;
		}
	}
	if (h==1)
	{
		c[f]='1';
		f=f+1;
	}
	for(i=250;i>=0;i--)
	{
		if(c[i]!='0'&&c[i]!='a')
		{
			k=i;
			break;
		}
	}
	if(k==-1)
		printf("0");
	else
	{
		for(i=k;i>=0;i--)
			printf("%c",c[i]);
	}
	return 0;
}
char s1[201],s2[201];
int a1[201],a2[201],nlen1,nlen2;
int main(){
	int i,j;
	memset(a1,0,sizeof(a1));
	memset(a2,0,sizeof(a2));
	cin.getline(s1,201);
	cin.getline(s2,201);
	nlen1=strlen(s1);
	nlen2=strlen(s2);
	j=0;
	for(i = nlen1-1; i >= 0; i--) a1[j++]=s1[i]-'0';
	j=0;
	for(i = nlen2-1; i >= 0; i--) a2[j++]=s2[i]-'0';
	for(i = 0; i <= 200; i++) a1[i]+=a2[i];
	for(i = 0; i <= 200; i++){
		if(a1[i] >= 10){
			a1[i]-=10;
			a1[i+1]++;
		}
	}
	i = 200;
	while(a1[i]==0) i--;
	if(i<0) cout<<"0"<<endl;
	else{
		j=i;
		for(i=j;i>=0;i--) cout<<a1[i];
		cout<<endl;
	}
	//cin>>i;
	return 0;
}
int main()
{ 
	const int MAX_LEN = 250;
	unsigned an1[MAX_LEN];
	unsigned an2[MAX_LEN];
	char seLine1[MAX_LEN + 1];
	char seLine2[MAX_LEN + 1];
	cin.getline(seLine1, MAX_LEN + 1);
	cin.getline(seLine2, MAX_LEN + 1);
	int nLen1 = strlen(seLine1);
	int nLen2 = strlen(seLine2);
	memset(an1, 0, sizeof(an1));
	memset(an2, 0,sizeof(an2));
	int i, j=0;
	for (i = nLen1-1;  i>=0; i--)
		an1[j++] = seLine1[i] - '0'; //???????????????
	j=0;
	for (i = nLen2-1; i>=0;i--)
		an2[j++] = seLine2[i] - '0';
	for (i = 0; i < MAX_LEN ;i++)
	{
		an1[i] += an2[i];
		if(an1[i] >= 10) //??????
		{
			an1[i] -=10;
			an1[i + 1]++; // i++?
		}
	}
	i = MAX_LEN - 1;
	for(;i>=0;i--)
		if(an1[i]!=0)
			break; //???????0??
	if(i==-1)
		cout<<0<<endl;
	else
	{
		for(;i >= 0; i--)
			cout << an1[i]; //??????
		cout << endl;
	}
	return 0;
}
char c1[210];
char c2[210];
int num1[210];
int num2[210];
int main()
{
	cin >> c1 >> c2;
	memset(num1, 0, sizeof(num1));
	memset(num2, 0, sizeof(num2));
	if ((strcmp(c1, "0") == 0) && (strcmp(c2, "0") == 0))
		cout << 0 << endl;
	for (int i = strlen(c1) - 1, j = 0; i >= 0; i--)
		num1[j++] = c1[i] - '0';
	for (int i = strlen(c2) - 1, j = 0; i >= 0; i--)
		num2[j++] = c2[i] - '0';
	int len = strlen(c1) > strlen(c2) ? strlen(c1) : strlen(c2);
	for (int i = 0; i < len; i++)
	{
		num1[i] += num2[i];
		if (num1[i] >= 10)
		{
			num1[i+1]++;
			num1[i] -= 10;
		}
	}
	
	for (int i = 0; i <= len; i++)
		c1[i] = num1[i] + '0';
	int pos = 209;
	while(num1[pos] == 0)
		pos--;
	for (int i = pos; i >= 0; i--)
		cout << c1[i];
	cout << endl;
	return 0;
}
int main()
{
	int a[MAX];
	int b[MAX];
	int r[MAX];
	memset(a, 0, sizeof(a));
	memset(b, 0, sizeof(b));
	memset(r, 0, sizeof(r));

	char tmp[MAX];
	int i, len;

	cin >> tmp;
	len = strlen(tmp);
	for (i = 0; i < len; i++)
		a[i] = tmp[len - 1 - i] - '0';

	cin >> tmp;
	len = strlen(tmp);
	for (i = 0; i < len; i++)
		b[i] = tmp[len - 1 - i] - '0';

	for (i = 0; i < MAX; i++)
	{
		int br = r[i] + a[i] + b[i];
		if (br < 10)
			r[i] = br;
		else
		{
			r[i] = br - 10;
			r[i + 1] = 1;
		}
	}
	
	i = MAX - 1;
	while (r[i] == 0 && i > 0)
		i--;

	for (; i >= 0; i--)
		cout << r[i];
	cout << endl;

	return 0;
}
int main(){
	int stop,i,count,l,j,k,mid,l1,l2,judge,b2[210]={0},b1[210]={0},re[210]={0};
	char a1[210]={0},a2[210]={0};
	count=0;
	judge=0;
	scanf("%s%s",a1,a2);
	l1=strlen(a1);
	l2=strlen(a2);
	for(i=210-l1;i<210;i++){
		b1[i]=a1[count]-'0';
		count++;
	}
	count=0;
	for(i=210-l2;i<210;i++){
		b2[i]=a2[count]-'0';
		count++;
	}
	if(l2>l1){
		l=l2+1;
	}else{
		l=l1+1;
	}
	for(i=209;i>=210-l;i--){
		re[i]+=b1[i]+b2[i];
		if(re[i]>=10){
			re[i]-=10;
			re[i-1]++;
		}
	}
	for(i=210-l;i<210;i++){
		if(re[i]==0&&judge==0){
			continue;
		}
		if(judge==0){
			if(re[i]!=0){
				judge++;
			}
		}
		if(judge!=0){
			printf("%d",re[i]);
		}
	}
	if(b1[209]==0&&b2[209]==0){
		printf("0");
	}
	scanf("%d",&stop);
	return 0;
}
int main()
{
	int i,l11,l21,l,s,l1,l2;
    char a[253],b[253],d[253];
	int a1[253],b1[253],c[253];
         scanf("%s\n%s",&a,&b);
	l11=strlen(a);
	l21=strlen(b);
	if (l11<l21) 
	{  strcpy(d,a);
	   strcpy(a,b);
	   strcpy(b,d);
	}
	l1=strlen(a);
	l2=strlen(b);
	l=l2-1;a1[0]=0;b1[0]=0;
    for (i=l1-1;i>=0;i--)
	{ 
		a1[i+1]=a[i]-'0';
		if (l>=0) {b1[i+1]=b[l]-'0';l--;} else b1[i+1]=0;
	}
    for (i=l1; i>=0;i--)
	{
		c[i]=a1[i]+b1[i];
		if (c[i]>=10) 
		{
			c[i]=c[i]-10;
            a1[i-1]=a1[i-1]+1;
		}
	}
         s=0;
	while (c[s]==0)
            s++;
//	for (i=1;i<=l1;i++)
//		printf("%d",a1[i]);printf("\n");
//	for (i=1;i<=l2;i++)
//		printf("%d",b1[i]);printf("\n");
	for (i=s;i<=l1;i++)
		printf("%d",c[i]);
	if (s>l1) printf("0");
	return 0;
}
main()
{
	char a[252],b[252],c[252];
	scanf ("%s",a);
	scanf ("%s",b);
	int i,k,m,n,p,d,e;
	d=strlen(a);
	e=strlen(b);
 	if (d<e)
    {for (i=1;i<=d;i++)
	 { c[e-i+1]=a[d-i]+b[e-i]-'0';
	   if (c[e-i+1]>=58)
	     {b[e-i-1]++; 
	      c[e-i+1]=c[e-i+1]-10;}
     }
     for (k=e-d-1;k>=1;k--)
	 	{
		 		if (b[k]>=58)
				 {b[k]=b[k]-10;	
				 b[k-1]++;}
				c[k+1]=b[k];
	    }
	    c[1]=b[0];
	    m=strlen(b);
    }
	else if(d>e)
	{for (i=1;i<=e;i++)
	 { c[d-i+1]=a[d-i]+b[e-i]-'0';
	   if (c[d-i+1]>=58)
	     {a[d-i-1]++; 
	      c[d-i+1]=c[d-i+1]-10;}
     }
     for (k=d-e-1;k>=1;k--)
	 	{
		 		if (a[k]>=58)
				 {a[k]=a[k]-10;	
				 a[k-1]++;}
				c[k+1]=a[k];
	    }
	    c[1]=a[0];
	    m=strlen(a);
    }
    else if (strlen(a)==strlen(b))
    {   
		for (i=strlen(b);i>0;i--)
        {c[i+1]=a[i]+b[i]-'0';
        if (c[i+1]>=58)
	     {b[i-1]++;
	      c[i+1]=c[i+1]-10;}}
		c[1]=a[0]+b[0]-'0';
		m=strlen(b);
	}
    if (c[1]>=58)
    {c[0]='1';
     c[1]=c[1]-10;
	 for (int l=0;l<m+1;l++)
	 printf ("%c",c[l]);}
	else if (c[1]=='0'&&m==01)
	printf ("0");
	else
	{for (int l=1;l<m+1;l++)
	 {if (c[l]!='0')
	 {p=l;
	 break;}}
	 for (i=p;i<m+1;i++)
	 printf ("%c",c[i]);}
	 }
char p[1001], q[1001];
int main()
{
    int j, k, n, m;
    char *a, *b;
    cin >> p >> q;
    if (strlen(p) < strlen(q))//?a???????
    {
        a = q;
        b = p;
    }
    else
    {
        a = p;
        b = q;
    }
    n = strlen(a) - 1;
    m = strlen(b) - 1;
    for (j = n, k = m; k >= 0; -- j, -- k)
        a[j] += b[k] - '0';
    for (j = n; j; -- j)//????
    {
        a[j - 1] += (a[j] - '0') / 10;
        a[j] = (a[j] - '0') % 10 + '0';
    }
    if (a[0] > '9')//???????
    {
        cout << 1;
        a[0] -= 10;
    }
    else
        while (strlen(a) != 1 && a[0] == '0')
            ++ a;
    cout << a << endl;
    return 0;
}
struct SeqList
{
	int MAXNUM;
	int n;
	int * element;
};
typedef struct SeqList * pSeqList;

pSeqList createNullList_Seq( int m)  //??????
{
	int i;
	pSeqList palist = (pSeqList) malloc(sizeof(struct SeqList));
	if (palist != NULL)
	{
		palist -> element = (int *)malloc(sizeof(int) * m);
		if(palist -> element)
		{
			palist -> MAXNUM = m;
			palist -> n = 0;
			for(i=0; i<m; i++)
				palist -> element[i] = 0;
			return palist;
		}
		else free( palist);
	}
	cout << "Out of space!! "<< endl;
	return NULL;
}

int isNullList_Seq(pSeqList palist)  //???????
{ 
	return (palist->n == 0);
}

int initialList_Seq(pSeqList pblist)  //??????
{
	int i;
	if(isNullList_Seq(pblist))  
		return -1;

	for(i=0; i<pblist -> n; i++)
		pblist -> element[i] = 0;
	return 0;

}

int insertEnd_Seq(pSeqList palist, int x)
{
	if(palist->n >= palist->MAXNUM)  //??
	{
		cout << "Overflow! " << endl;
		return -1;
	}
	palist->element[palist->n] = x;
	palist->n += 1;
	return 0;
}

int add(pSeqList num1, pSeqList num2, pSeqList sum)
{
	int a = initialList_Seq( sum);   //?sum????????
	int i;
	for(i=0; i< MAX_LEN; i++) 
		//?num1?num2???????????????sum??
		sum->element[i] = num1->element[i] + num2->element[i];
	for(i=0; i<= MAX_LEN; i++)
		if(sum->element[i] > 9)
		{
			sum->element[i] -= 10;
			sum->element[i+1] += 1;
		}
	return 0;

}

int printList_Seq(pSeqList result)  //????
{
	if(isNullList_Seq(result) == 0)  //??????
		return -1;
	int i;
	int flag = 0;    
	for(i=MAX_LEN; i >=0; i--)
	{
		if(result->element[i] != 0)   //??????????????
			flag = 1;
		if(flag == 0)  continue;
		cout << result->element[i];
	}
	if(flag == 0)  cout << 0;
	cout << endl;
	return 0;
}

int main()
{
	pSeqList element1 = createNullList_Seq(MAX_LEN);
	pSeqList element2 = createNullList_Seq(MAX_LEN);
	pSeqList result = createNullList_Seq(MAX_LEN+1);

	char szLine1[MAX_LEN+10];
	char szLine2[MAX_LEN+10];
	cin >> szLine1 >> szLine2;

	int lenth1 = strlen(szLine1);
	int lenth2 = strlen(szLine2);
	//cout << "eeeee1" << endl;
	if(lenth1>MAX_LEN ||  lenth2>MAX_LEN)
	{
		cout << "Input error!!" << endl;
	    return 0;
	}
   //cout << "eeeee2" << endl;
	int i;
	for(i = lenth1-1; i>=0; i --)
	{
		int a = insertEnd_Seq(element1, szLine1[i]-'0');
		if(a == -1)
		{
			cout << "Input error !! " << endl;
			return 0;
		}
	}
    for(i = lenth2-1; i>=0; i --)
	{
		int b = insertEnd_Seq(element2, szLine2[i]-'0');
		if(b == -1)
		{
			cout << "Input error !! " << endl;
			return 0;
		}
	}
	//cout << "eeeee3" << endl;
	int c = add(element1, element2, result);
	if(c == -1)
	{
		cout << "Fail in add!! " << endl;
		return 0;
	}
	//cout << "eeeee4" << endl;
	printList_Seq(result);
	//cout << "eeeee5" << endl;

	return 0;
}
int main(){
	const int l = 200;
	int n1[l + 10], n2[l +10];
	char n10[l + 10], n20[l + 10];
	int i, j;
	for(i = 0; i < l + 10; i++)
		n1[i] = n2[i] = n10[i] = n20[i] = 0;
	cin >> n10 >> n20;
	int l1 = strlen(n10);
	int l2 = strlen(n20);
	i = l1 + 1, j = 0;
	while(--i){
		n1[j] = n10[i - 1] - '0';
		j++;
	}
	i = l2 + 1; j = 0;
	while(--i){
		n2[j] = n20[i - 1] - '0';
		j++;
	}
	int lm = l1 > l2 ? l1 : l2;
	for(i = 0; i < lm; i++){
		n1[i] += n2[i];
		if(n1[i] > 9){
			n1[i + 1] += n1[i] / 10;
			n1[i] = n1[i] % 10;
		}
	}
	i = l + 1;
	while(n1[i] == 0) i--;
	if(i < 0) cout << '0';
	else{
		i++;
		while(i--)
			cout << n1[i ];
	}
	return 0;
}
int a[10000],b[10000],c[10000],d[10000];

void jia(int a[10000],int b[10000])
{
    int i,j,k,m;
    for (i=0;i<=9000;i++)
    c[i]=0;
    m=a[0]+b[0]-1;
    for (i=1;i<=a[0]+b[0]-1;i++)
    {
        c[i]=c[i]+a[i]+b[i];
        c[i+1]=c[i]/10;
        c[i]=c[i]%10;
    }
    j=m+10;
    while (j>1&&c[j]==0) j--;
    for (i=j;i>=1;i--)
    cout <<c[i];
    cout <<endl;
}

int main()
{
    int i,j,k,m,n;
    int len1=0,len2=0;
    char s1[10000],s2[10000];
    cin >>s1;
    cin >>s2;
    len1=strlen(s1);
    len2=strlen(s2);
    a[0]=len1;
    b[0]=len2;
    for (i=1;i<=len1;i++)
    a[len1-i+1]=((int)s1[i-1])-48;
    for (i=1;i<=len2;i++)
    b[len2-i+1]=((int)s2[i-1])-48;
    jia(a,b);
    return 0;
}