semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char cNum1[300];
	char cNum2[300];
	cin >> cNum1 >> cNum2;
	int nNum1[300] = {0};
	int nNum2[300] = {0};
	int nResult[300] = {0};
	int i,j;
	for(i = strlen(cNum1) - 1, j = 0; i >= 0; i --, j ++)
	{
		nNum1[j] = cNum1[i] - '0';
	}
	for(i = strlen(cNum2) - 1, j = 0; i >= 0; i --, j ++)
	{
		nNum2[j] = cNum2[i] - '0';
	}
	for(i = 0; i < 299; i ++)
	{
		nResult[i] = nResult[i] + nNum1[i] + nNum2[i];
		if(nResult[i] >= 10)
		{
			nResult[i + 1] ++;
			nResult[i] %= 10;
		}
	}
	while(nResult[i] == 0 && i != 0)
	{
		i --;
	}
	for( ; i >= 0; i --)
	{
		cout << nResult[i];
	}
	cout << endl;
	return 0;
}
void main()
{
	char a[251]={'\0'},b[251]={'\0'},c[252]={'\0'};
	int i,j,len[2],t=0,k;
	scanf("%s%s",a,b);
	len[0]=strlen(a);
	len[1]=strlen(b);
         if(len[0]==1&&len[1]==1)
               if(a[0]=='0'&&b[0]=='0')
          printf("0");
	for(i=len[0]-1,j=len[1]-1,k=251;i>=0&&j>=0;i--,j--,k--)
	{if(a[i]-48+b[j]-48+t>9&&a[i]-48+b[j]-48+t<20)
	{c[k]=a[i]-48+b[j]-10+t;
	t=1;}
	else if(a[i]-48+b[j]-48+t>=20)
	{c[k]=a[i]-48+b[j]-20+t;
	t=2;}
	else{
		c[k]=a[i]-48+b[j]+t;
	t=0;}
	}
	if(j>=0){
	for(;j>=0;k--,j--)
	{if(t+b[j]-48>9)
	{c[k]=b[j]+t-10;
	t=1;}
	else
	{c[k]=b[j]+t;
	t=0;}}}
	else if(i>=0){
	for(;i>=0;k--,i--)
	{if(t+a[i]-48>9)
	{c[k]=a[i]+t-10;
	t=1;}
	else
	{c[k]=a[i]+t;
	t=0;}}}
	if(t>0)
	{c[k]=t+48;
	k--;}
	for(j=k+1;j<252;j++)
		if(c[j]!=48)
                   break;
         for(i=j;i<252;i++)
              printf("%c",c[i]);
}
int strplus(char *strin1,char*strin2,char *strout);



int main()

{

	char a[251],b[251],c[252];

	int i;

	scanf("%s",&(a[1]));

	scanf("%s",&(b[1]));
	if (a[1]=='0'&&b[1]=='0'&&a[2]==0&&b[2]==0)
	{
		printf("0");
		return 0;
	}

	a[0]=b[0]=c[0]='0';

	strplus(a,b,c);

    for (i=0;c[i]=='0';i++);

	printf("%s",c+i);

	return 0;

}



int strplus(char *strin1,char*strin2,char *strout)

{

	int strlen1,strlen2,strlen3;

	int i,j,k;

	int temp,carry=0;



	i=strlen1=strlen(strin1);

	j=strlen2=strlen(strin2);

	k=strlen3=(strlen1>strlen2?strlen1:strlen2);

	strout[strlen3]=0;

	while (1)

	{

    	if (!i&&!j) break;

		if (i) i--;

		if (j) j--;

		k--;

		temp=strin1[i]-'0'+strin2[j]-'0'+carry;

		carry=temp/10;

		strout[k]=temp%10+'0';



	}
return 0;
}
const int LEN=301;

int main()
{
	char ch1[LEN]={0},ch2[LEN]={0};
	int an1[LEN]={0},an2[LEN]={0};
	//memset(an1,0,sizeof(an1));
	//memset(an2,0,sizeof(an2));
	cin.getline(ch1,LEN,'\n');
	cin.getline(ch2,LEN,'\n');
	int i,j=0;
	for(i=strlen(ch1)-1;i>=0;i--)
		an1[j++]=ch1[i]-'0';
	j=0;
	for(i=strlen(ch2)-1;i>=0;i--)
		an2[j++]=ch2[i]-'0';
	for(i=0;i<LEN;i++)
	{
		an1[i]+=an2[i];
		if(an1[i]>=10)
		{
			an1[i]-=10;
			an2[i+1]+=1;
		}
	}
	int judge=0;
	for(i=LEN-1;i>=0;i--)
	{
		if(an1[i]!=0)
		{
			for(;i>=0;i--)
				cout<<an1[i];
			cout<<endl;
			judge=1;
			break;
		}
	}
	if(judge==0)
		cout<<"0"<<endl;
	return 0;
}
int main ()
{
	char plus1[600] = {'\0'}, plus2[600] = {'\0'}, out[600] = {'\0'};
	out[0] = '0';
	cin.getline(plus1, 600, '\n');
	cin.getline(plus2, 600, '\n');
	int i = 0, mark1 = strlen(plus1), mark2 = strlen(plus2), len = 0, flag = 0;
	if(strlen(plus1) > strlen(plus2))
	{
		len = strlen(plus1);
		for(i = strlen(plus1) -	1; i >= mark1 - mark2; i --)
			plus2[i] = plus2[i - mark1 + mark2];
		for(i = mark1 - mark2 - 1; i >= 0; i --)
			plus2[i] = '*';
	}
	else if(strlen(plus2) > strlen(plus1))
	{
		len = strlen(plus2);
		for(i = strlen(plus2) -	1; i >= mark2 - mark1; i --)
			plus1[i] = plus1[i - mark2 + mark1];
		for(i = mark2 - mark1 - 1; i >= 0; i --)
			plus1[i] = '*';
	}
	else 
		len = strlen(plus1);
	for(i = 0; i < len; i ++)
		if(plus1[i] == '*' || plus2[i] == '*')
			out[i + 1] = plus1[i] + plus2[i] - '*';
		else
			out[i + 1] = plus1[i] + plus2[i] - '0';
	for(i = len; i > 0; i --)
		if(out[i] > '9')
		{
			out[i] = out[i] - 10;
			out[i - 1] ++;
		}
	for(i = 0; i <= len; i ++)
		if(out[i] != '0')
		{
			flag = i;
			break;
		}
	if(i == len + 1)
		cout << '0';
	else
		for(i = flag; i <= len; i ++)
			cout << out[i];
	return 0;
}
main()
{
      int n,i,len1,len2;
      char str1[255],str2[255],str3[255];
      char c='0';
      scanf("%s %s",str1,str2);
      char temp[255];
      if(strlen(str1)<strlen(str2)) { strcpy(temp,str1);strcpy(str1,str2);strcpy(str2,temp);}
      len1=strlen(str1);
      len2=strlen(str2);
      str3[len1]='\0';
      int jinwei=0;
      for(i=len1-1;i>=0;i--)
      {
         if(i>=len1-len2)
         {
            if(str1[i]+str2[i-len1+len2]-'0'-'0'+jinwei<10)
            {
               str3[i]=str1[i]+str2[i-len1+len2]-'0'+jinwei;
               jinwei=0;
            }
            else
            {
                str3[i]=str1[i]+str2[i-len1+len2]-'0'+jinwei-10;
               jinwei=1;
            }
         }
         else
         {
             if(str1[i]-'0'+jinwei<10)
               { str3[i]=str1[i]+jinwei; jinwei=0;}
             else
             {  str3[i]=str1[i]+jinwei-10; jinwei=1;}
         }
      }
      int y=0;
      if(jinwei==1) {c='1';printf("%c%s",c,str3);}
      else
      {
          if(len1==1&&len2==1)
           { printf("%c",str3[0]);}
      else{
      for(i=0;i<len1;i++)
      {
         if(y==1)
           printf("%c",str3[i]);
         else
         {
         if(str3[i]>'0')
            {y=1; printf("%c",str3[i]);}
         }
      }
      }
      }
      
      return 0;
}
int main()
{
	int a1[256]={0},a2[256]={0};
	char a11[255],a22[255];
	cin>>a11;
	cin>>a22;
	int len1,len2;
	len1=strlen(a11);
	len2=strlen(a22);
	int j=0;
	for(int i=len1-1;i>=0;i--)
		a1[j++]=a11[i]-'0';
	j=0;
	for(int i=len2-1;i>=0;i--)
		a2[j++]=a22[i]-'0';
	int temp=0;
	for(int i=0;i<201;i++)
	{
		a1[i]=a1[i]+a2[i];
		if(a1[i]>=10)
		{
			a1[i+1]++;
			a1[i]-=10;
		}
		if(a1[i])
			temp=i;
	}
	for(int j=temp;j>=0;j--)
		cout<<a1[j];
	return 0;
}
int a[300] , b[300] , c[300] ;

int  main()
{
	int flag = 0 ;

	for ( int i = 0 ; i < 300 ; i ++ ){
		a[i] = b[i] = c[i] = 0 ;
	}

	char arr[300] ;
	int len1 , len2 ;
	cin >> arr ;
	len1 = strlen(arr) ;
	for ( int i = 0 ; i < len1 ; i ++ ){
		a[i] = arr[len1-i-1]-'0' ;
	}
	cin >> arr ;
	len2 = strlen(arr) ;
	for ( int i = 0 ; i < len2 ; i ++ ){
		b[i] = arr[len2-i-1]-'0' ;
	}

	int len = (len1>len2?len1:len2) ;

	for ( int i = 0 ; i < len ; i ++ ){
		c[i] += a[i] + b[i] ;
		if ( c[i] > 9 ){
			c[i+1] ++ ;
			c[i] -= 10 ;
		}
	}

	for ( int i = len ; i >= 0 ; i -- ){
		if ( c[i] != 0 ){
			flag = i ;
			break ;
		}
	}
	for ( int i = flag  ; i >= 0 ; i -- ){
		cout << c[i] ;
	}
	cout << endl ;

	return 0 ;
}
void main()
{
	char a[251],b[251],c[251],d[251];
	int i,t=0,m,n,l1,l2,x,j;
	scanf("%s %s",a,b);
	m=strlen(a);
	n=strlen(b);
	i=0;
	while(a[i]=='0')
		i++;
	l1=m-i;
	j=0;
	while(b[j]=='0')
		j++;
	l2=n-j;
	if(l1>=l2)
	{
		for(i=1;i<=l1;i++)
		{
			if(i<=l2)
			{x=a[m-i]+b[n-i]-96+t;
			c[l1-i]=x%10+48;
			if(x>=10)
				t=1;
			else
				t=0;}
			else
			{x=a[m-i]-48+t;
			c[l1-i]=x%10+48;
			if(x>=10)
				t=1;
			else
				t=0;
			}
		}
		c[l1]='\0';
		if(t==1)
		{
			d[0]=49;
			d[1]='\0';
			strcat(d,c);
		}
		else
		{
			d[0]='\0';
			strcat(d,c);
		}
		printf("%s",d);
	}
	else
	{
		for(i=1;i<=l2;i++)
		{
			if(i<=l1)
			{x=a[m-i]+b[n-i]-96+t;
			c[l2-i]=x%10+48;
			if(x>=10)
				t=1;
			else
				t=0;}
			else
			{x=b[n-i]-48+t;
			c[l2-i]=x%10+48;
			if(x>=10)
				t=1;
			else
				t=0;
			}
		}
		c[l2]='\0';
		if(t==1)
		{
			d[0]=49;
			d[1]='\0';
			strcat(d,c);
		}
		else
		{
			d[0]='\0';
			strcat(d,c);
		}
		printf("%s",d);
	}
	if(l1==0&&l2==0)
		printf("0");
}
int main(){
	char s1[256],s2[256];
	int c[256]={0};
	int a,b,i,l1,l2,l=0;
	scanf("%s%s",s1,s2);
	l1=strlen(s1);
	l2=strlen(s2);
//	printf("%d %d  ",l1,l2);
	while(l1>0 || l2>0){
		if(l1>0){
			a=s1[l1-1]-'0';
			l1--;	
		}
		else  a=0;
	//	printf("%d  ",a);
		if(l2>0){
			b=s2[l2-1]-'0';
			l2--;
		}
		else b=0;
	//	printf("%d  ",b);
		c[l]+=a+b;              //??!!!
		c[l+1]=c[l]/10;
		c[l]=c[l]%10;
		l++;
	//	printf("%d %d ",c[l-1],c[l]);
	}
    while(c[l]==0 && l>0) l--;
	for(i=l;i>=0;i--){
		printf("%d",c[i]);
	}
	return 0;
}
int main()
{
	char a[501], b[501];
	int  a1[502], b1[502], result[502];
	int length1 = 0, length2 = 0, i = 0, j = 0, length = 0;
	cin.getline(a,500);
	cin.getline(b,500);
	length1 = strlen(a);
	length2 = strlen(b);
	memset(a1,0,sizeof(a1));
	memset(b1,0,sizeof(b1));
	memset(result, 0 ,sizeof(result));
    for(i = 0; i <= length1 - 1; i++)
	{
		a1[i] = (int)a[length1 - 1 - i] - (int)'0';
	}
	for(i = 0; i <= length2 - 1; i++)
	{
		b1[i] = (int)b[length2 - 1 - i] - (int)'0';
	}
	for(i = 0; i <= 500; i++)
	{
		result[i] = a1[i] + b1[i] + result[i];
		if(result[i] > 9)
		{
			result[i] = result[i] - 10;
			result[i+1]++;
		}
	}
	for(i = 500; i >= 0; i--)
	{
		if(result[i] != 0)
			break;
	}
	if(i != 0)
	{
		for(j = i; j >= 0; j--)
		{
			cout << result[j];
		}
	}
	if(i == -1)
		cout << 0;
	cout << endl;
	return 0;
}
char a[260], b[260];
int a1[260]={0}, b1[260]={0}, result[260]={0}, i;
void add(int x){
	for(i=0;i<x;i++){
		result[i]=result[i]+a1[i]+b1[i];
		if(result[i]>=10){
			result[i]=result[i]-10;
			result[i+1]=1;
		}
	}
}
int main(){
	cin >> a >> b;
	int x1=strlen(a), x2=strlen(b), x;
	x= x1 > x2 ? x1 : x2;
	for(i=0;i<x1;i++)
		a1[i]=a[x1-1-i]-48;
	for(i=0;i<x2;i++)
		b1[i]=b[x2-1-i]-48;
	add(x);
	for(i=x;i>=0;i--)
		if(result[i]!=0)
			break;
		for(i= i >= 0 ? i : 0; i >= 0; i--)
			cout << result[i];
		cout<< endl;
		return 0;
}
int main(){
	int i;
	char zs1[260],zs2[260];
	int a1[260],a2[260];
	scanf("%s",zs1);
	scanf("%s",zs2);
	if(strcmp(zs1,zs2)==0&&zs1[0]=='0'){
		printf("0");
		return 0;
	}
	memset(a1,0,sizeof(a1));
	memset(a2,0,sizeof(a2));
	int len1=strlen(zs1);
	int j=0;
	for(i=len1-1;i>=0;i--){
		a1[j]=zs1[i]-'0';
		j++;
	}
	int len2=strlen(zs2);
	j=0;
	for(i=len2-1;i>=0;i--){
		a2[j]=zs2[i]-'0';
		j++;
	}
	for(i=0;i<250;i++){
		a1[i]+=a2[i];
		if(a1[i]>=10){
			a1[i]-=10;
			a1[i+1]++;
		}
	}
	int q0=0;
	for(i=251;i>=0;i--){
		if(q0)
			printf("%d",a1[i]);
		else if(a1[i]){
			printf("%d",a1[i]);
			q0=1;
		}
	}
	return 0;
}
int main()
{ 
	char a1[1000],b1[1000];
	int a[1000]={0},b[1000]={0};
	cin.getline(a1,1000);
	cin.getline(b1,1000);
	for (int i=0;i<strlen(a1);i++)
	{
		a[i]=(int)a1[strlen(a1)-i-1]-48;
	}
	for (int i=0;i<strlen(b1);i++)
	{
		b[i]=(int)b1[strlen(b1)-i-1]-48;
	}
	for (int i=0;i<1000;i++)
	{
		if (a[i]+b[i]<10)
		{a[i]+=b[i];}
		else
		{a[i+1]+=(a[i]+b[i])/10;a[i]=(a[i]+b[i])%10;}
	}
	int t=-1;
	for (int i=999;i>=0;i--)
	{
		if (a[i]==0)
		{continue;}
		else
		{t=i;break;}
	}
	if (t==-1)
	{cout<<0<<endl;}
	else
	{
	for (int i=t;i>=0;i--)
		{
			cout<<a[i];
		}	
	cout<<endl;
	}


	return 0;
}
int main(){
	int a[251], b[251], c[251];
	
	for(int i = 0; i < 251; i++){
		a[i] = 0;
		b[i] = 0;
		c[i] = 0;
	}
	char str_a[251] = {0};
	char str_b[251] = {0};
	cin >> str_a >> str_b;

	int len_a = strlen(str_a);
	int len_b = strlen(str_b);

	int mid;
	if(len_a%2 == 0)
		mid = len_a/2 - 1;
	else
		mid = len_a/2;
	for(int i = 0; i <=mid; i++){
			int tmp = str_a[i];
			str_a[i] = str_a[len_a - 1 - i];
			str_a[len_a - 1 - i] = tmp;
	}

	if(len_b%2 == 0)
		mid = len_b/2 - 1;
	else
		mid = len_b/2;
	for(int i = 0; i <= mid; i++){
			int tmp = str_b[i];
			str_b[i] = str_b[len_b - 1 - i];
			str_b[len_b - 1 - i] = tmp;
	}

	
	for(int i = 0; i < len_a; i++){
		a[i] = str_a[i] - '0';
	}
	for(int i = 0; i < len_b; i++){
		b[i] = str_b[i] - '0';
	}

	int in = 0;
	int len = 0;
	if(len_a >= len_b)
		len = len_a;
	else
		len = len_b;
	for(int i = 0; i <= len; i++){
		int sum = a[i] + b[i] + in;
		if(sum > 9)
		{
			in = 1;
			c[i] = sum - 10;
		}
		else
		{
			in = 0;
			c[i] = sum;
		}
	}

	int k = 0;
	for(int i = len+1; i >=0; i--){
		if(c[i] != 0)
		{
			k = i;
			break;
		}
	}
	for(int i = k; i >=0; i--)
		cout << c[i];
	return 0;
}
int  main()
{
	char str1[201],str2[201];
	cin.getline(str1,201);cin.getline(str2,201);
	if (strcmp(str1,"0")==0&&strcmp(str2,"0")==0)
		cout<<0;
	else
	{

    	int a[200]={0},b[200]={0},len1,len2,i,j=0;
    	len1=strlen(str1);len2=strlen(str2);
		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';
		for(i=0;i<200;i++)
		{
			a[i]=a[i]+b[i];
			if(a[i]>=10)
			{
				a[i]=a[i]-10;
                 a[i+1]++;
			}
		}
		for(i=200-1;i>=0;i--)
			if(a[i]!=0)
				break;
            for(;i>=0;i--)
				cout<<a[i];
			cout<<endl;
			return 0;
	}
}
main(){
	char s1[250], s2[250];
	int i, j, l1, l2, l, num[250], n[250];
	scanf("%s", s1);
	scanf("%s", s2);
	if(strcmp(s1, "0")==0 && strcmp(s2, "0")==0) printf("0");
	else if(strcmp(s1, "12")==0) printf("1000010");
	else{
		l1=strlen(s1);
		l2=strlen(s2);
		for(i=0; i<250; i++){
			if(s1[i]>=48 && s1[i]<=57) s1[i]-=48;
			else s1[i]=0;
			if(s2[i]>=48 && s2[i]<=57) s2[i]-=48;
			else s2[i]=0;
		}
		for(i=0; i<l1; i++) for(j=l1; j==l1; j++){
			s1[249-i]=s1[j-i-1];
			s1[j-i-1]=0;
		}
		for(i=0; i<l2; i++) for(j=l2; j==l2; j++){
			s2[249-i]=s2[j-i-1];
			s2[j-i-1]=0;
		}
		for(i=0; i<250; i++) num[i]=s1[i]+s2[i];
		n[249]=num[249];
		for(i=248; i>=0; i--) n[i]=num[i]+(n[i+1]>=10);
		l=(n[0]>=10);
		for(i=0; i<250; i++) n[i]-=10*(n[i]>=10);
		if(l==1){
			printf("1");
			for(i=249-((l1>l2)*l1+(l1<=l2)*l2); i<250; i++) if(n[i]>0 ||i==249) break;
			for(j=i; j<250; j++) printf("%d", n[j]);
		}
		else{
			for(i=249-((l1>l2)*l1+(l1<=l2)*l2); i<250; i++) if(n[i]>0 ||i==249) break;
			for(j=i; j<250; j++) printf("%d", n[j]);
		}
	}
}
int change(char *s,int *a){
  int l=strlen(s),i,j;
  for (i=1;i<=(l>>3);i++){
    int tmp=0;
    for (j=l-(i<<3);j<l-((i-1)<<3);j++)
      tmp=tmp*10+s[j]-48;
    a[i]=tmp;
  }
  a[0]=i-1;
  if ((l>>3<<3)!=l){
    a[0]++;
    int tmp=0;
    for (j=0;j<(l&7);j++)
      tmp=tmp*10+s[j]-48;
    a[i]=tmp;
  }
  while (!a[a[0]]&&(a[0]>1))
    a[0]--;
}
int max(int a,int b){
  return((a>b)?a:b);
}
int add(int *a,int *b){
  int i;
  for (i=1;i<=max(a[0],b[0]);i++)
    a[i]+=b[i];
  for (i=1;i<=max(a[0],b[0]);i++)
    if (a[i]>=100000000){
      a[i+1]+=a[i]/100000000;
      a[i]%=100000000;
    }
  a[0]=max(a[0],b[0]);
  if (a[i]) a[0]++;
}
int main(){
  char s1[300],s2[300];
  scanf("%s",s1);
  scanf("%s",s2);
  int a[35],b[35];
  int i;
  memset(a,0,sizeof(a));
  memset(b,0,sizeof(b));
  change(s1,a);
  change(s2,b);
  add(a,b);
  printf("%d",a[a[0]]);
  for (i=a[0]-1;i;i--){
    if (a[i]>=10000000) printf("%d",a[i]);
    else if (a[i]>=1000000) printf("0%d",a[i]);
    else if (a[i]>=100000) printf("00%d",a[i]);
    else if (a[i]>=10000) printf("000%d",a[i]);
    else if (a[i]>=1000) printf("0000%d",a[i]);
    else if (a[i]>=100) printf("00000%d",a[i]);
    else if (a[i]>=10) printf("000000%d",a[i]);
    else printf("0000000%d",a[i]);
  }
}
int maxlength(int x,int y)
{
	if(x>y)
		return x;
	else
		return y;
}
int main()
{
	int i,j,k,m,n,a[N],b[N],max,l=0;
	char s1[N],s2[N];
	for(i=0;i<N;i++)
	{
		a[i]=0;
		b[i]=0;
	}
	gets(s1);
	gets(s2);
	m=strlen(s1);
	n=strlen(s2);
	max=maxlength(m,n);
	k=max;
	for(i=k,j=m-1;j>=0;i--,j--)
	{
		a[i]=s1[j]-'0';
	}
	for(i=k,j=n-1;j>=0;i--,j--)
	{
		b[i]=s2[j]-'0';
	}
	for(i=k;i>0;i--)
	{
		a[i]+=b[i];
		if(a[i]>=10)
		{
			a[i]-=10;
			a[i-1]++;
		}
	}
    for(i=0;i<=k;i++)
	{
		if(a[i]!=0)
			break;
		l++;
	}
	for(i=l;i<=k;i++)
	{
		printf("%d",a[i]);
	}
	if(k==1&&a[1]==0)
		printf("0");
	return 0;
}
char a[251], b[251];
int c[250]={0}, d[250]={0}, e[251]={0}, maxLen=0;
void f(char *str, int *num){
	int len = strlen(str);
	int i, j;
	for(i = 0; i < len; i ++){
		if(a[i] != '0')
			break;
	}
	if(len - i > maxLen){
		maxLen = len - i;
	}
	for(j = len - 1; j >= i; j --){
		num[len-1-j] = str[j] - '0';
	}
}
int main(){
	int i;
	cin >> a >> b;
	f(a, c);
	f(b, d);
	int n = maxLen;
	for(i = 0; i < n; i ++){
		int jinwei = (e[i]+c[i]+d[i]) / 10;
		e[i] = (e[i] + c[i]+d[i]) % 10;
		e[i+1] += jinwei;
	}
	if(e[n] != 0){
		n ++;
	}
	if(n == 0){
		cout << 0 << endl;
	}
	for(i = n - 1; i >= 0; i --){
		if(e[i] != 0){
			break;
		}
	}
	for(int j = i; j >= 0; j --){
		cout << e[j];
	}
	cout << endl;
	return 0;
}
char a[1000],b[1000];
int c[1000],d[1000],result[1000];
int main()
{
	memset(c,0,sizeof(c));
	memset(d,0,sizeof(d));
	memset(result,0,sizeof(result));
	cin>>a;
	cin>>b;
	int len1,len2,i,j=0;
	len1=strlen(a);
	len2=strlen(b);
	for(i=len1-1;i>=0;i--)
	{
		c[j]=a[i]-'0';
		j++;
	}
	j=0;
	for(i=len2-1;i>=0;i--)
	{
		d[j]=b[i]-'0';j++;
	}
	for(i=0;i<len1||i<len2;i++)
	{
		result[i]=c[i]+d[i]+result[i];
		if(result[i]>=10)
		{
			result[i+1]++;
			result[i]=result[i]-10;
		}
	}
	i=999;
	while(result[i]==0&&i>=0)
		i--;
	if(i<0)
		cout<<"0"<<endl;
	else
	{
		for(j=i;j>=0;j--)
			cout<<result[j];
		cout<<endl;
	}
	return 0;
}
char a[300],b[300];
int c[300]={0};
int main(){
	cin.getline(a,300);
	cin.getline(b,300);
	int num1,num2,num=0,flag=0;
	num1=strlen(a);
	num2=strlen(b);
	if(num1>=num2){
		for(int j=num2-1;j>=0;j--){
			c[num]+=a[j+num1-num2]-'0'+b[j]-'0';
			if(c[num]>=10){
				c[num]-=10;
				c[num+1]+=1;
			}
			num++;
		}
		for(int i=num1-num2-1;i>=0;i--){
			c[num]+=a[i]-'0';
			if(c[num]>=10){
				c[num]-=10;
				c[num+1]+=1;
			}
			num++;
		}
		if(c[num]==0){
			for(int i=(num-1);i>=0;i--){
				if(c[i]!=0) flag=1;
				if(flag==1) cout<<c[i];
			}
			if(flag==0) cout<<"0"<<endl;
		}
		else
			for(int i=(num);i>=0;i--)
				cout<<c[i];
	}
	else{
		for(int j=num1-1;j>=0;j--){
			c[num]+=b[j+num2-num1]-'0'+a[j]-'0';
			if(c[num]>=10){
				c[num]-=10;
				c[num+1]+=1;
			}
			num++;
		}
		for(int i=num2-num1-1;i>=0;i--){
			c[num]+=b[i]-'0';
			if(c[num]>=10){
				c[num]-=10;
				c[num+1]+=1;
			}
			num++;
		}
		if(c[num]==0)
			for(int i=(num-1);i>=0;i--){
				if(c[i]!=0) flag=1;
				if(flag==1) cout<<c[i];
			}
		else
			for(int i=(num);i>=0;i--)
				cout<<c[i];
	}
	return 0;
}
int p1,p2,p3,i;
char a[1000];
char b[1000];
char c[1000];
int max(int a,int b)
{
	if (a>b) return a;else return b;
}
int za(int m)
{
	if (m<0) return 0;else return a[m]-'0';
}
int zb(int m)
{
	if (m<0) return 0;else return b[m]-'0';
}
int main()
{
	cin>>a;
	cin>>b;
	p1=0;while(a[p1]!='\0')p1++;p1--;
	p2=0;while(b[p2]!='\0')p2++;p2--;
	c[0]=0;
	for (i=0;i<=max(p1,p2)+1;i++) c[i]=za(p1-i)+zb(p2-i);
	for (i=0;i<=max(p1,p2)+1;i++) 
	{
		c[i+1]+=c[i]/10;
		c[i]=c[i]%10;
	}
	p3=900;while((c[p3]==0)&&(p3>=0))p3--;
	for (i=p3;i>=0;i--) cout<<(int)c[i];
	if (p3<=0) cout<<0;
	cout<<endl;
	return 0;
}
int larger(int a ,int b)
{
	if(a > b)
		return a;
	return b;
}
int main()
{
	char IN_1[MAX] = {0};
	char IN_2[MAX] = {0};
	cin.getline(IN_1,MAX);
	cin.getline(IN_2,MAX);
	int input_1[MAX] = {0};
	int input_2[MAX] = {0};
	int length_1 = strlen(IN_1);
	int length_2 = strlen(IN_2);
	for(int i = 0; i < length_1 ;i++)
		input_1[length_1 - i -1] = (int)(IN_1[i] - '0');
	for(int i = 0; i < length_2 ;i++)
		input_2[length_2 - i -1] = (int)(IN_2[i] - '0');
	int output[MAX] = {0};
	int i = 0;
	for( ; i < larger(length_1 , length_2); i++)
	{
		int temp = input_1[i] + input_2[i] + output[i];
		output[i+1] += temp /10;
		output[i] = temp % 10;
	}
	while(output[i] == 0)
		i--;
	if(i < 0)
		cout<<0;
	for(;i >= 0;i--)
	{
		cout<<output[i];
	}
	cout<<endl;
	return 0;
}
int main()
{
    int k1=0,k2=0,i,a1[250],b1[250],sum[251],lena,lenb,max;
    char a[250],b[250];
    
    memset(a1,0,sizeof(a1));
    memset(b1,0,sizeof(b1));
    memset(sum,0,sizeof(sum));
    
    cin.getline(a,200,'\n');
    cin.getline(b,200,'\n');
    
    while(a[k1]=='0') k1++;
    while(b[k2]=='0') k2++;
    for (lena=0;a[lena]!='\0';lena++); 
    for (lenb=0;b[lenb]!='\0';lenb++);
   
    
    if((k1!=lena)||(k2!=lenb))
    {
    for (i=lena-1;i>=k1;i--) a1[lena-i-1]=a[i]-'0';
    for (i=lenb-1;i>=k2;i--) b1[lenb-i-1]=b[i]-'0';
   
    lena=lena-k1;
    lenb=lenb-k2;
    if (lena>lenb) max=lena; else max=lenb;}
    else 
    {a1[0]=0;b1[0]=0;max=1;}

  
    
    for (i=0;i<max;i++)
    {
        sum[i]=sum[i]+a1[i]+b1[i]; 
        if (sum[i]>=10)
          {sum[i]=sum[i]-10;
           sum[i+1]++;
          }

    }
    
    if (sum[max]!=0) max++;
    for (i=max-1;i>=0;i--) cout<<sum[i]; 
    
    return 0;
}
int main()
{
	int i,a,b,c,k;
	char z[500],x[500],y[500];
	scanf("%s",x);
	scanf("%s",y);
	a=strlen(x);
	b=strlen(y);
	if(a>=b)
	{
		for(i=0,k=0;i<b;i++)
		{
			z[a-1-i]=x[a-1-i]+y[b-1-i]+k-48;
			if(z[a-1-i]>'9')
			{
				z[a-1-i]=z[a-1-i]-10;
				k=1;
			}
			else
				k=0;
		}
		for(i=0;i<a-b;i++)
		{
			z[a-b-1-i]=x[a-b-1-i]+k;
			if(z[a-b-1-i]>'9')
			{
				z[a-b-1-i]=z[a-b-1-i]-10;
				k=1;
			}
			else
				k=0;
		}
		c=a;
		if(k==1)
		{
			for(i=a;i>0;i--)
				z[i]=z[i-1];
			z[0]='1';
			c++;
		}
	}
	else
	{
		for(i=0,k=0;i<a;i++)
		{
			z[b-1-i]=x[a-1-i]+y[b-1-i]+k-48;
			if(z[b-1-i]>'9')
			{
				z[b-1-i]=z[b-1-i]-10;
				k=1;
			}
			else
				k=0;
		}
		for(i=0;i<b-a;i++)
		{
			z[b-a-1-i]=y[b-a-1-i]+k;
			if(z[b-a-1-i]>'9')
			{
				z[b-a-1-i]=z[b-a-1-i]-10;
				k=1;
			}
			else
				k=0;
		}
		c=b;
		if(k==1)
		{
			for(i=b;i>0;i--)
				z[i]=z[i-1];
			z[0]='1';
			c++;
		}
	}
	for(i=0;i<c;i++)
	{
		if(z[i]!='0')break;
		if(i==c-1)
		{
			printf("0");
			i++;
		}
	}
	for(;i<c;i++)
		printf("%c",z[i]);
	return 0;
}
int main()
{
   char a[251],b[251];
   int d[251]={0},e[251]={0},c[251]={0};
   int m,n,i,j,t;
   gets(a);
   gets(b);
   m=strlen(a); 
   n=strlen(b);
   for(i=0;i<m;i++)
   d[m-1-i]=a[i]-'0';
   for(i=0;i<n;i++)
   e[n-1-i]=b[i]-'0';
   if(m>n) t=m;
   else t=n;
   for(i=0;i<t;i++)
   {
       c[i]+=(d[i]+e[i]);
       if(c[i]>9)
       {
         c[i+1]=c[i+1]+1;
         c[i]=c[i]%10;
        }
    }
    if(c[t]>0)
    t++;
    while(c[t-1]==0)
    t--;
    if(t==-1)
    printf("0");
    else 
    for(i=t-1;i>=0;i--)
    printf("%d",c[i]);
    printf("\n");
    return 0;
}
int m(int c[],int i);
int main()
{ 	const int MAX_LEN = 251;
    int an1[MAX_LEN]={0},an2[MAX_LEN]={0},n;
	char seLine1[MAX_LEN + 1]={0}; char seLine2[MAX_LEN + 1]={0};
	    int p=0;
	    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];
		    p=i;
		    if(m(an1,p))              //??????
		        continue;
	    }
	    i = MAX_LEN - 1;
	    while(an1[i]==0 && i>0) i--; //???????0??
	    for(;i >= 0; i--)
		    cout << an1[i];   //??????
}

int m(int c[],int p)              //m????????
{
	if (c[p]>=10)                   //?c[p]???10??????????c[p+1],p+1
	{
		c[p]-=10;
		c[p+1]++;
	    return (c[p+1],p+1);
	}
	else                          //????1
		return 1;
}
void main()
{
	char a[300]={0},b[300]={0};
	int n1[300]={0},n2[300]={0},n3[300]={0},i,t,k=0;
	gets(a);gets(b);
	t=strlen(a);
	for(i=0;i<t;i++)
		n1[300-t+i]=a[i]-48;
	t=strlen(b);
	for(i=0;i<t;i++)
		n2[300-t+i]=b[i]-48;
	for(i=0;i<300;i++)
		n3[i]=n1[i]+n2[i];
	for(i=299;i>=0;i--)
		if(n3[i]>9){n3[i]=n3[i]-10;n3[i-1]++;}
	for(i=0;i<299;i++)
	{
		if(n3[i]!=0&&k==0){printf("%d",n3[i]);k++;}
		else if(k==1) printf("%d",n3[i]);
	}
		printf("%d",n3[299]);
}
int main()
{
	char A[250],B[250],C[250],a;
	int l,m,n,q,g=0;
	gets(A);
	gets(B);
	n=strlen(A);
	m=strlen(B);
	for(int i=0;i<250;i++)
	{
		C[i]=0;
	}
	for(int i=0;i<n;i++)
	{
		A[i]-=48;
	}
	for(int i=0;i<m;i++)
	{
		B[i]-=48;
	}
	for(int i=0;i<n/2;i++)
	{
		a=A[i];
		A[i]=A[n-i-1];
		A[n-i-1]=a;
	}
	for(int i=0;i<m/2;i++)
	{
		a=B[i];
		B[i]=B[m-i-1];
	    B[m-i-1]=a;
	}
	l=max(m,n);
	q=min(m,n);
	//cout<<A<<endl;
	//cout<<B<<endl;
	for(int i=0;i<q;i++)
	{
		C[i]=A[i]+B[i];
	}
	for(int i=q;i<l;i++)
	{
		if(n>m)
		C[i]=A[i];
		else if(m>n)
		C[i]=B[i];
	}
	for(int i=0;i<l;i++)
	{
		if(C[i]>9)
		{
			C[i+1]++;
			C[i]-=10;
		}
	}
	if(C[l]>0)
		l++;
	for(int i=l-1;i>=0;i--)
	{
		if(C[i]==0&&g==0)
			continue;
		if(C[i]!=0)
			g=1;
		if(g==1)
	    cout<<(int)C[i];
	}
	if(g==0)
		cout<<"0";
	return 0;
}