semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
     char str1[252],str2[252];
     int a[300],b[300],c[300];
     memset( a,0,sizeof(a) );
     memset( b,0,sizeof(b) );
     memset( c,0,sizeof(c) );
     int i, j , k , n,l1,l2,l3;
     gets(str1);
     gets(str2);
     l1 = strlen(str1);
     l2 = strlen(str2);
     for( i = l1-1 ;i >=0;i-- )
     a[l1-i] = str1[i] - '0';
     for( i = l2-1; i >=0;i--) 
     b[l2-i] = str2[i] - '0';
     if( l1>=l2 )
     l3 = l1;
     else l3 = l2;
     for( i = 1;i <= l3;i++ )
     {
     c[i] += a[i] +b[i];
     if( c[i]>=10 )
     {
     c[i+1]++;
     c[i]-=10;
     }
     }
     for( k = l3+1;k>=0;k-- )
     {if( c[k]!= 0  )break;}
     if( k <= 0 )printf("0");
     else
     {
     for( i = k ; i>0;i-- )
     printf( "%d",c[i] );
     }    
}
char a[250],b[250],sum[251];
main()
{
	int lena,lenb,i,l,f;//l???????? 
	scanf("%s %s",a,b);
	lena=strlen(a);//????a??? 
	lenb=strlen(b);//????b???
	if(lena>lenb) l=lena;
	else l=lenb;
	for(i=0;i<l;i++)
    	a[i]-='0',b[i]-='0';//?????ASCII?????,??????????? 
	if(lena>lenb)
    	{  
			for(i=lena-1;i>=lena-lenb;i--)//??i?lena-lenb???lena-1????? 
				b[i]=b[i-lena+lenb];
			for(i=0;i<lena-lenb;i++)
				b[i]=0;
		}
	else if(lena<lenb) 
    	{ 
			for(i=lenb-1;i>=lenb-lena;i--)
				a[i]=a[i-lenb+lena];
			for(i=0;i<lenb-lena;i++)
				a[i]=0;
		}//????????????????????? 
	f=l;
	for(i=0;i<l;i++)
		sum[i+1]=a[i]+b[i];//?????,????  i+1????????????????????? 
	for(i=l;i>=0;i--)
		if(sum[i]>9)
			sum[i]-=10,sum[i-1]++;//?? 
	for(i=l;i>=0;i--)
		if(sum[i]!=0) f=i;
	for(i=f;i<=l;i++)
		printf("%d",sum[i]);
}
int main()
{
    int x,j,i,l,t,q=0,w=0,y,m[300]={0},n[300]={0},k[300]={0};
    char a[300],b[300];
    scanf("%s %s",&a,&b);
    x=strlen(a);
    y=strlen(b);
    
    for(i=x;i>=0;i--) {m[i]=a[i]-'0';if(m[i]==0) q+=1;}
    for(i=y;i>=0;i--) {n[i]=b[i]-'0';if(n[i]==0) w+=1;}
    if(q==x&&w==y) {printf("0");return 0;}
    if(x>=y)
    {
        l=x;
        for(i=x;i>=x-y+1;i--) 
        {    
            k[i]=k[i]+m[i-1]+n[i-x+y-1];
            if(k[i]>=10)
            {
                k[i]=k[i]-10;
                k[i-1]=k[i-1]+1;    
            }
        }
        for(i=x-y;i>0;i--) 
        {
            k[i]=k[i]+m[i-1];
            if(k[i]>=10)
            {
                k[i]=k[i]-10;
                k[i-1]=k[i-1]+1;    
            }
        }
    }
    if(x<y)
    {
        l=y;
        for(i=y;i>=y-x+1;i--) 
        {    
            k[i]=k[i]+n[i-1]+m[i-y+x-1];
            if(k[i]>=10)
            {
                k[i]=k[i]-10;
                k[i-1]=k[i-1]+1;
            }
        }
        for(i=y-x;i>0;i--) 
        {
            k[i]=k[i]+n[i-1];
            if(k[i]>=10)
            {
                k[i]=k[i]-10;
                k[i-1]=k[i-1]+1;    
            }
        }
    }
    //printf("%d %d %d",k[0],k[1],k[2]);
    memset(a,0,sizeof(a));
    for(i=0;i<=l;i++)
    {
        if(k[i]!=0) {j=i;t=l+1-j;break;}
    }
    for(i=0;i<=t-1;i++) 
    {
        a[i]=k[j+i]+'0';
    }
    printf("%s",a);
    return 0;
}
/*
 *???: bigAdd.cpp
 *??: ???
 *????: 2012-11-21
 *??: ?????
 */



void conv(int a[],char str[]) //????str?????????a
{
	memset(a,0,sizeof(int)*MAXN); //?a??
	int l=strlen(str); //????
	for (int i=l-1;i>=0;--i)
		a[l-1-i]=str[i]-'0'; //????????a????
}

void BigNumAdd(int a[],int b[],int c[]) //?????a,b?????c
{
	memset(c,0,sizeof(int)*MAXN); //c??
	for (int i=0;i<MAXN;i++){
		c[i]+=a[i]+b[i];
		if (c[i]>=10){ //???
			c[i+1]++; //??
			c[i]-=10;
		}
	}
}

void printBigNum(int a[]) //???????
{
	int i;
	for (i=MAXN-1;a[i]==0&&i>=0;--i) //?a??0????
		;
	if (i==-1){ //???0
		cout << 0 << endl;
		return;
	}
	for (;i>=0;--i)
		cout << a[i];
	cout << endl;
}

int main()
{
	int a[MAXN],b[MAXN],c[MAXN];
	char str[MAXN]; //????????

	cin >> str;
	conv(a,str); //?????????a
	cin >> str;
	conv(b,str);
	BigNumAdd(a,b,c); //c=a+b
	printBigNum(c);
	return 0;
}
int main( )
{
	char a[251], b[251], c[251];
	int p=0, n;
	cin >> c;
	for (int i = strlen(c) - 1; i >= 0; i--)  //??????????????a[i]
		a[strlen(c) - 1 - i] = c[i];
	for (int i = strlen(c); i < 251; i++)     //???????0
		a[i] = '0';
	cin >> c;
	for (int i = strlen(c) - 1; i >= 0; i--)  //??????????????b[i]
		b[strlen(c) - 1 - i] = c[i];
	for (int i = strlen(c); i < 251; i++)     //???????0
		b[i] = '0';
	for (int i = 0; i < 251; i++)      //?a[i],b[i]????????
	{
		c[i] = a[i] + b[i] + p - 48;
		if (c[i] >= 58)                //???
		{
			c[i] -= 10;
			p = 1;
		}
		else p = 0;                    //???
	}
	for (n = 250; n >= 0; n--)    //?a[i],b[i]??c[i]??????????0??????
		if (c[n] != '0') break;
	if (n == -1) cout << 0;       //????0???0
	for (; n >= 0; n--)
		cout << c[n];
	cout << endl;
	return 0;
}
int main()
{   
	char num1[251],num2[251];
	int a[251],b[251],c[251],d[251],len1,len2,i=0,j=0;
	memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
	memset(c,0,sizeof(c));
	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++)
	{
		d[i]=a[i]+b[i]+c[i];
		if(d[i]>=10)
		{
			d[i]=d[i]-10;
			c[i+1]++;
		}
	}
	for(j=250;j>=0;j--)
	{
		if(d[j]!=0)break;
	}
	for(i=j;i>=0;i--)
	{cout<<d[i];}
	return 0;
}
int strReverse(char *str)
{
	int len = strlen(str);
	for (int i = 0; i<len / 2; i++)
	{
		char temp=str[i];
		str[i] = str[len - i-1];
		str[len - i-1] = temp;
	}
	return len;
}

int addBig(char *l, int lLen, char*s, int sLen, int *c)
{
	for (int i = 0; i < lLen; i++)
	{
		if (i < sLen)
		{
			c[i] = c[i] + l[i] - '0' + s[i] - '0' ;
			c[i + 1] = c[i] / 10;;
			c[i] %= 10;
		}
		else
		{
			c[i] = c[i] + l[i] - '0';
			c[i + 1] = c[i] / 10;
			c[i] %= 10;
		}
	}
	return c[lLen] ? (lLen + 1) : lLen;
}

void printBig(int *a, int len)
{
	int k = len - 1;
	while (a[k] == 0 && k > 0)
	{
		k--;
	}
	for (int i = k; i >= 0; i--)
	{
		cout << a[i];
	}
	cout << endl;
}

int main()
{
	char a[MAX], b[MAX];
	cin.getline(a, MAX);
	cin.getline(b, MAX);
	int aLen, bLen, cLen;
	aLen = strReverse(a);
	bLen = strReverse(b);
	int c[MAX] = { 0 };
	cLen = (aLen > bLen) ? addBig(a, aLen, b, bLen, c):addBig(b,bLen,a,aLen,c);
	printBig(c, cLen);
	return 0;
}
void back(char a[])
{
     int l,i;
     char b[1001];
     l=strlen(a);
     for(i=0;i<l;i++)
     {
                     b[i]=a[l-i-1];
     }
     b[l]='\0';
     strcpy(a,b);
}
void full(char a[])
{
     int l,i;
     l=strlen(a);
     for(i=l;i<1000;i++)
     {
                         a[i]='0';
     }
     a[1000]='\0';
}
void recur(char a[])
{
     int i;
     for(i=999;i>=0;i--)
     {
                        if(a[i]!='0')
                        {
                                     a[i+1]=0;
                                     break;
                        }
     }
     back(a);
}
void plus(char a[],char b[],char sum[])
{
      int i;
      back(a);
      back(b);
      full(a);
      full(b);
      for(i=0;i<1000;i++)
      {
                          if(a[i]>'9')
                          {a[i]=a[i]-10;a[i+1]=a[i+1]+1;}
                          if((a[i]+b[i]-2*'0')>9)
                          {sum[i]=a[i]+b[i]-'0'-10;a[i+1]=a[i+1]+1;}
                          else
                          {sum[i]=a[i]+b[i]-'0';}
      }
      recur(b);
      recur(sum);
}
void minus(char a[],char b[],char difference[])
{
     int i,w=0;
     back(a);
     back(b);
     full(a);
     full(b);
     for(i=0;i<1000;i++)
     {
                       if(w==1)
                       a[i]=a[i]-1;
                       if(a[i]<b[i])
                       {
                                    difference[i]=a[i]+10-b[i]+'0';
                                    w=1;
                       }
                       else
                       {
                           difference[i]=a[i]-b[i]+'0';
                           w=0;
                       }
     }
     for(i=999;difference[i]=='0';i--);
     if(i>=0)
     difference[i+1]='\0';
     else
     difference[1]='\0';
     back(difference);
}
main()
{
      char a[1001],b[1001],sum[1001];
      scanf("%s %s",a,b);
      if(a[0]=='0'&&a[1]==0&&b[0]=='0'&&b[1]==0)
      printf("0");
      else
      {
          plus(a,b,sum);
          puts(sum);
      }
      getchar();
      getchar();
}
int main()
{
	char a[300]={'\0'};
	char b[300]={'\0'};
	char answer[300]={'\0'};
	char c[300]={'\0'};
	int n;
	int m;
	int i,j;
	int jinwei=0;
	gets(a);
	gets(b);
	for(m=0;;m++)
	{
		if(b[m]=='\0')
		{
			break;
		}
	}
	for(n=0;;n++)
	{
		if(a[n]=='\0')
		{
			break;
		}
	}
	for(i=0;i<=n-1;i++)
	{
		c[n-1-i]=a[i];
	}
	for(i=0;i<=n-1;i++)
	{
		a[i]=c[i];
	}
	for(i=0;i<=n-1;i++)
	{
		c[n-1-i]='0';
	}
	for(i=0;i<=m-1;i++)
	{
		c[m-1-i]=b[i];
	}
	for(i=0;i<=m-1;i++)
	{
		b[i]=c[i];
	}
	for(i=0;i<=m-1;i++)
	{
		c[m-1-i]='0';
	}
	for(i=0;i<=299;i++)
	{
		answer[i]='0';
	}
	for(i=m;i<=299;i++)
	{
		b[i]='0';
	}
    for(i=n;i<=299;i++)
	{
		a[i]='0';
	}
	for(i=0;i<=299;i++)
	{
		if(a[i]+b[i]+jinwei-96<=9&&a[i]+b[i]+jinwei-96>=0)
		{
			answer[i]=a[i]+b[i]-48+jinwei;
			jinwei=0;
		}
		else
		{
			if(a[i]+b[i]+jinwei-96>=10)
			{
				answer[i]=a[i]+b[i]-48-10+jinwei;
			    jinwei=1;
			}
		}
	}
	for(i=299;i>=0;i--)
	{
		if(answer[i]!='0')
		{
			break;
		}
	}
	if(i!=-1)
	{
	for(j=i;j>=0;j--)
	{
		printf("%c",answer[j]);
	}
	}
	else
	{
		printf("0");
	}
	printf("\n");
	return 0;
}
int main(){
	int n,i,la,lb,r,p=0;
	char e,a[252]={'\0'},b[252]={'\0'},c[252]={'\0'};
	scanf("%s%s",a,b);
	la=strlen(a);
	lb=strlen(b);
	for(i=0;i<la-i;i++){
		e=a[i];
		a[i]=a[la-i-1];
		a[la-i-1]=e;
	}
	for(i=0;i<lb-i;i++){
		e=b[i];
		b[i]=b[lb-i-1];
		b[lb-i-1]=e;
	}
	for(i=la;i<252;i++){
		a[i]='0';
	}
	for(i=lb;i<252;i++){
		b[i]='0';
	}
	for(i=0;i<252;i++){
		r=a[i]-'0'+b[i]-'0'+p;
		if(r>=10){
			c[i]=r%10+'0';
			p=r/10;
		}else{
			c[i]='0'+r;
			p=0;
		}
//		if(r==0){
//			break;
//		}
	}
	for(i=251;i>0;i--){
		if(c[i]!='0'){
			break;
		}else{
			c[i]='\0';
		}
	}
	r=strlen(c);
	for(i=0;i<r-i;i++){
		e=c[i];
		c[i]=c[r-i-1];
		c[r-1-i]=e;
	}
	printf("%s",c);
//	scanf("%d",&n);
	return 0;
}
int main()
{
	int i,j,num1=0,num2=0,k1,k2,a,b,tmp=0,head=0;
	char m[251];
	char n[251];
	char total[255];
	char x[251];
	char y[251];
	gets(m);
	gets(n);
	for(i=0;m[i]!='\0'&&(m[i]>='0'&&m[i]<='9');i++)
	{
		num1++;
	}
	m[i]='\0';
	for(j=0;n[j]!='\0'&&(n[j]>='0'&&n[j]<='9');j++)
	{
		num2++;
	}
	n[j] = '\0';
	if(num1>=num2)
	{
		strcpy(x,m);
		strcpy(y,n);
		k1=num1;
		k2=num2;
	}
	else
	{
		strcpy(x,n);
		strcpy(n,m);
		num1 = strlen(x);
		num2 = strlen(n);
		k1=num1;
		k2=num2;
	}

	{
		for(j=num1;j>num1-num2-1;j--)
		{
			n[j]=n[k2];
			k2--;
		}
		for(j=num1-num2-1;j>=0;j--)
		{
			n[j]='0';
		}
		for(j=num1-1;j>=0;j--)
		{
		   if(x[j]-'0'+n[j]-'0'+tmp>9)
		   {
			  total[j]='0'+(x[j]-'0'+n[j]-'0'+tmp)%10;
			  tmp = 1;
		   }
		   else
		   {
			  total[j]='0'+(x[j]-'0'+n[j]-'0'+tmp)%10;
			  tmp = 0;
		   }
		}
		total[num1]= '\0';
		if( tmp ==1 )
		{
			printf("1");
			head = 1;
		}
	    for(j=0;j<num1;j++)
		{
			if(total[j]=='0'&&head==0) continue;
			head = 1;
			printf("%c",total[j]);
		}
		printf("\n");
	}
    return 0;
}
//
//  Created by Chu-Pan,Wong on Dec 3, 2013.
//  Copyright (c) 2013 ChuPan,Wong. All rights reserved.
//



int a[250];
int b[250];
char num[251];

int main(int argc, char** argv){
    scanf("%s", num);
    int aa = (int)strlen(num);
    for (int i=0; i<aa; i++) {
        a[i] = num[aa-1-i]-'0';
    }
    scanf("%s", num);
    int bb = (int)strlen(num);
    for (int i=0; i<bb; i++) {
        b[i] = num[bb-1-i]-'0';
    }
    for (int i=0; i<250; i++) {
        a[i] = a[i]+b[i];
        if (a[i]>9) {
            a[i+1]++;
            a[i]-=10;
        }
    }
    for (int i=0; i<250; i++) {
        if (a[i]>9) {
            a[i+1]++;
            a[i]-=10;
        }
    }
    int max=0;
    for (int i=249; i>=0; i--) {
        if(a[i]!=0){
            max = i;
            break;
        }
    }
    for (int i=max; i>=0; i--) {
        cout<<a[i];
    }
    cout<<endl;
    return 0;
}
int main()
{
	int l1,l2,i,j=0, c[251],d[252];char a[251],b[251];                                       //????????????
	memset(a,0,sizeof(a));memset(b,0,sizeof(b));memset(c,0,sizeof(c));memset(d,0,sizeof(d)); //??????
	cin >> a >> b;                                                                           //?????
	l1=strlen(a);l2=strlen(b);                                                               //?????????????????
	for(i=l1-1;i>=0;i--)
		c[j++]=a[i]-'0';
	j=0;
	for(i=l2-1;i>=0;i--)
		d[j++]=b[i]-'0';
	for(i=0;i<250;i++)                                                                       //???
	{
		c[i]=c[i]+d[i];
		if(c[i]>=10)
		{
			c[i]=c[i]-10;
			c[i+1]=c[i+1]+1;
		}
	}
	i=250;
	while(c[i]==0&&i>0)                                                                      //???
		i--;
	for(j=i;j>=0;j--)
		cout <<c[j];
	cout << endl;
	return 0;
}
int main()
{
    int a1[266]={0},a2[266]={0};
    int len1,len2;
    char b1[266],b2[266];
    cin.getline(b1,266);
    cin.getline(b2,266);
    len1=strlen(b1);//?? 
    len2=strlen(b2);
    if(len1==1&&len2==1&&b1[0]=='0'&&b2[0]=='0')
    cout<<0<<endl;
    else{
         int i=0,j=0;
    for(i=len1-1;i>=0;i--)
      a1[j++]=b1[i]-'0';//??????????? 
    j=0;
    for(i=len2-1;i>=0;i--)
      a2[j++]=b2[i]-'0';
    for(i=0;i<=266;i++)
    {
       a1[i]+=a2[i];
       if(a1[i]>=10)
       {
          a1[i]-=10;
          a1[i+1]++;
       }  
    }
    i=265;
    while(a1[i]==0)i--;
    for(;i>=0;i--)
    cout<<a1[i];
    cout<<endl;}
    return 0; 
}
int main()
{   int i,j,t,MAXLEN,flag=0;
	char s1[500],s2[500];
	int a1[500]={0},a2[500]={0},a[500]={0};
	scanf("%s",s1);
	scanf("%s",s2);
	for(i=0;i<strlen(s1);i++){
		a1[strlen(s1)-1-i]=s1[i]-'0';
	}
	for(i=0;i<strlen(s2);i++){
		a2[strlen(s2)-1-i]=s2[i]-'0';
	}
	MAXLEN=(strlen(s1)>=strlen(s2))?strlen(s1):strlen(s2);
	for(i=0;i<MAXLEN;i++){
		t=a1[i]+a2[i]+a[i];
		if(t>=10){
			if(i!=MAXLEN-1){
				a[i]=t%10;
				a[i+1]=1;
				j=MAXLEN;
			}
			else{
				a[i]=t%10;
				a[i+1]=1;
				j=MAXLEN+1;
			}
		}
		else{
			a[i]=t;
			j=MAXLEN;
		}
	}
	for(i=j-1;i>=0;i--){
		if(a[i]!=0){
			flag=1;
			if(flag){
				printf("%d",a[i]);				}
			}
		else{
			if(flag){
				printf("%d",a[i]);
			}
		}
	}
	if(flag==0){
		printf("0");
	}
	return 0;
}
int main(){
    char aa[1000],bb[1000],cc[1000],dd[1000];
    int i=0,j=0,k;
    cin>>aa>>bb;
    while(aa[i]!='\0')
    i++;
    while(bb[j]!='\0')
    j++;
    if(i<j){                               
    k=i;
    i=j;
    j=k;
    strcpy(dd,aa);
    strcpy(aa,bb);
    strcpy(bb,dd);
    }      
                     
    for(k=1;k<=i;k++){
        if(k<=j){
        if(aa[i-k]+bb[j-k]-48>57){          
        cc[i+1-k]=aa[i-k]+bb[j-k]-58;
        if(k!=i)
        aa[i-k-1]++;
        else cc[0]='1';
        }
        else {cc[i+1-k]=aa[i-k]+bb[j-k]-48;
              if(k==i)
              cc[0]=0;
        }
        }
      else {
           if(aa[i-k]>57)
          { cc[i-k+1]=aa[i-k]-10;
           if(k!=i)
           aa[i-k-1]++;
           else cc[0]='1'; 
           }
           else {
                cc[i-k+1]=aa[i-k];
                 if(k==i)
                 cc[0]='0';
           }
           }
           }
          j=0;
           while((cc[j]<=48||cc[j]>57)&&j<i){
           j++;
           }
         for(k=j;k<=i;k++)
           cout<<cc[k];
           cout<<endl;
           
                   return 0;
}
int main()
{
    char a[250],b[250],c[250];
    int aa[250],bb[250],cc[250],dd[250],add;
    scanf("%s",a);
    scanf("%s",b);

    int l1,l2,i,j;
    l1=strlen(a);
    l2=strlen(b);

    if (l1>=l2)
    {
        for(i=0;i<l1-l2;i++)
            c[i]='0';
        for(j=i;j<l1;j++) c[j]=b[j-l1+l2];

        for(i=0;i<l1;i++) aa[i]=a[i]-48;
        for(i=0;i<l1;i++) cc[i]=c[i]-48;
        add=0;
        for(j=l1-1;j>=1;j--)
            if((cc[j]+aa[j]+add)<=9)
            {
                dd[j]=cc[j]+aa[j]+add;
                add=0;
            }
            else
            {
                dd[j]=cc[j]+aa[j]+add-10;
                add=1;
            }

        j=0;
        if(cc[j]+aa[j]+add<=9)
        {
            dd[j]=cc[j]+aa[j]+add;
            for(i=0;i<l1;i++) if (dd[i]!=0) break;
            if (i==l1) printf("%d",0);
            else
            for(j=i;j<=l1-1;j++)
            printf("%d",dd[j]);
        }
        else
        {
            dd[j]=cc[j]+aa[j]+add-10;
            printf("%d",1);
            for(j=0;j<=l1-1;j++)
            printf("%d",dd[j]);
        }


    }
    else
    {
        for(i=0;i<l2-l1;i++)
            c[i]='0';
        for(j=i;j<l2;j++) c[j]=a[j-l2+l1];

        for(i=0;i<l2;i++) aa[i]=b[i]-48;
        for(i=0;i<l2;i++) cc[i]=c[i]-48;
        add=0;
        for(j=l2-1;j>=1;j--)



            if((cc[j]+aa[j]+add)<=9)
            {
                dd[j]=cc[j]+aa[j]+add;
                add=0;
            }
            else
            {
                dd[j]=cc[j]+aa[j]+add-10;
                add=1;
            }
        j=0;
        if(cc[j]+aa[j]+add<=9)
        {
            dd[j]=cc[j]+aa[j]+add;
            for(i=0;i<l2;i++) if (dd[i]!=0) break;
            if (i==l1) printf("%d",0);
            else
            for(j=i;j<=l2-1;j++)
            printf("%d",dd[j]);
        }
        else
        {
            dd[j]=cc[j]+aa[j]+add-10;
            printf("%d",1);
            for(j=0;j<=l2-1;j++)
            printf("%d",dd[j]);
        }
    }
}
int main()
{
    int i;
    int num1[256]={0},num2[256]={0},ans[256]={0};
    char str[256];
    cin>>str;
    for(i=strlen(str);i>=0;--i) num1[i]=str[strlen(str)-i]-'0';
     cin>>str;
    for(i=strlen(str);i>=0;--i) num2[i]=str[strlen(str)-i]-'0';
    for(i=0;i<255;++i) ans[i]=num1[i]+num2[i];
    for(i=0;i<255;++i)
    {
        if(ans[i]>=10)
        {
            ans[i+1]++;
            ans[i]-=10;
        }
    }
    for(i=255;i>=0;--i) if(ans[i]) break;
    if(i==0) cout<<0<<endl;
    else
    {
        for(;i>0;--i) cout<<ans[i];
        cout<<endl;
    }
    return 0;
}
int main(int argc, char* argv[])

{
	char a[252],b[252],c[253];
	c[0]=48;
	scanf("%s%s",a,b);
	int la,lb,t,r,s;
    la=strlen(a);
	lb=strlen(b);
	if(la>lb){
		for(r=lb-1;r>=0;r--){
			b[r+la-lb]=b[r];
		}
		for(s=0;s<=la-lb-1;s++){
			b[s]=48;
		}
		t=la;
	}
    if(la<lb){
		for(r=la-1;r>=0;r--){
			a[r+lb-la]=a[r];
		}
		for(s=0;s<=lb-la-1;s++){
			a[s]=48;
		}
		t=lb;
	}
	if(la==lb){
		t=la;
	}
	int i,j,k=0;
	for(i=0;i<=t-1;i++){
		c[i+1]=a[i]+b[i]-48;
	}
	for(i=t;i>=1;i--){
		if (c[i]>=58){
			c[i]=c[i]-10;
			c[i-1]=c[i-1]+1;
		}
	}
	for (j=0;j<=t;j++){
		if(c[j]!=48){
			break;
		}
		k++;
	}
	if(k==t+1){
		printf("0");
	}
	else{
		for(j=k;j<=t;j++){
			printf("%c",c[j]);
		}
	}
	return 0;
}
int a[maxx];
int b[maxx];
int c[maxx];
char temp[maxx];
int main()
{
	int n;
	int mm;
	memset(c,0,sizeof(c));
	cin.getline(temp,251);
	a[0] = strlen(temp);
	for(int i = a[0]; i >= 1; --i)
	{
		a[a[0] - i + 1] = temp[i-1] - '0';
	}
	while(a[a[0]] == 0 && a[0] > 1)
	{
		a[0]--;
	}
	cin.getline(temp,251);
	b[0] = strlen(temp);
	for(int i = b[0]; i >= 1; --i)
	{
		b[b[0] - i + 1] = temp[i-1] - '0';
	}
	while(b[b[0]] == 0 && b[0]>1)
	{
		b[0]--;
	}
	int len = max(a[0],b[0]);
	int temp = 0;
	int tempsum;
	for(int i = 1; i <= len; ++i)
	{
		tempsum = a[i] + b[i] + temp;
		c[i] = (tempsum)%10;
		if(tempsum >= 10)
		{
			temp = 1;
		}
		else
		{
			temp = 0;
		}
	}
	if(temp == 1)
	{
		c[len + 1]  += 1;
		len = len + 1;
	}

	for(int i = len; i>=1; --i)
	{
		cout << c[i];
	}

	return 0;
}
int main()
{
	char as[201]="0",bs[201]="0";
	int a[201],b[201],sum[201];
	int lena,lenb,len,jinwei=0;
	int i,j;
	scanf("%s %s",as,bs);
	lena=strlen(as);
	lenb=strlen(bs);
	len=lena>lenb?lena:lenb;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	for(i=200;i>200-lena;i--)
		a[i]=as[lena-201+i]-'0';
	for(i=200;i>200-lenb;i--)
		b[i]=bs[lenb-201+i]-'0';
	for(i=200;i>200-len-1;i--)
	{
		sum[i]=(jinwei+a[i]+b[i])%10;
		jinwei=(jinwei+a[i]+b[i])/10;
	}
	for(i=200-len;i<=200;i++)
	{
		if(sum[i]!=0)
		{
			for(j=i;j<=200;j++)
				printf("%d",sum[j]);
			break;
		}
		else if(i==200)
			printf("0\n");
		
	}
}
int add(char x,char y);
int over(char x,char y);
int main()
{
	char a[260],b[260];
	char c[260];
	int i,j;
	int len,lena,lenb,lenc;
	int o=0;
	int count=0;
	int highesta,highestb;
	scanf("%s",a);
	scanf("%s",b);
	lena=(int)strlen(a);
	lenb=(int)strlen(b);
	len=(lena>lenb)? lena:lenb;
	if (len==lena)
	{
		for (i=lenb;i>=0;i--)
		{
			b[i+lena-lenb]=b[i];
		}
		for (i=0;i<lena-lenb;i++)
		{
			b[i]='0';
		}
	}
	else
	{
		for (i=lena;i>=0;i--)
		{
			a[i+lenb-lena]=a[i];
		}
		for (i=0;i<lenb-lena;i++)
		{
			a[i]='0';
		}
	}
	for (i=len-1;i>=0;i--)
	{
		if (i==len-1)
		{
			c[i]=(char)(add(a[i],b[i])+48);
			o=over(a[i],b[i]);
		}
		if (i>0 && i<len-1)
		{
			if ((add(a[i],b[i])+o)==10)
			{
				c[i]='0';
				o=1;
			}
			else
			{
				c[i]=(char)(add(a[i],b[i])+48+o);
				o=over(a[i],b[i]);
			}
		}
		if (i==0)
		{
			highesta=((int)a[0])-48;
			highestb=((int)b[0])-48;
			if (highesta+highestb+o>=10)
			{
				for (j=len-1;j>=1;j--)
				{
					c[j+1]=c[j];
				}
				c[0]='1';
				c[1]=(char)((highesta+highestb+o-10)+48);
				c[len+1]='\0';
			}
			else
			{
				c[0]=(char)((highesta+highestb+o)+48);
				c[len]='\0';
			}
		}
	}
	lenc=strlen(c);
	for (i=0;i<lenc-1;i++)
	{
		if (c[i]=='0')
		{
			count++;
		}
		else
		{
			break;
		}
	}
	for (i=count;i<lenc-1;i++)
	{
		printf("%c",c[i]);
	}
	printf("%c\n",c[lenc-1]);
	return 0;
}
int add(char x,char y)
{
	int m,n;
	int result;
	m=((int)x)-48;
	n=((int)y)-48;
	result=(m+n>=10)? (m+n-10):(m+n);
	return result;
}
int over(char u,char v)
{
	int p,q;
	int overflow;
	p=((int)u)-48;
	q=((int)v)-48;
	overflow=(p+q>=10)? 1:0;
	return overflow;
}
int c[202],aa[200],bb[200];
int main ()
{
	int add(char *a,char *b);
	char a[200],b[200];
	int cclen,j;
	gets(a);
	gets(b);
	cclen=add(a,b);
	for(j=cclen;j>=0;j--){
      printf("%d",c[j]);
       }
}
int add(char *a,char *b)
{
	int i,k,len;
	int alen=strlen(a);
	int blen=strlen(b);
	len=(alen>blen)? alen:blen;
	k=0;	
	for(i=alen-1;i>=0;i--){
        aa[k]=a[i]-'0';
        k++;      
        }
    k=0;
    for(i=blen-1;i>=0;i--){
        bb[k]=b[i]-'0';
        k++;      
        }
    c[0]=0;
    for(i=0;i<len;i++){
        if(i<alen) c[i]+=aa[i];
        if(i<blen) c[i]+=bb[i];
    }
    for(i=0;i<len;i++){
        c[i+1]+=c[i]/10;
        c[i]=c[i]%10;
        }
    k=len;
    for(i=len;i>0;i--){
       if(c[i]==0)
       k--;
       else
       break;
       }  
    return k;  
}
int main()
{
	int a[270] , b[270] , i , wp , wq ;
	char s1[270] , s2[270] ;
	for (i = 0 ; i < 251 ; i++)
	{
		a[i] = -1 ;
		b[i] = -1 ;	
	}
	int *p = a , *q = b ;   //p??a????q??b??? 
	cin >> s1 ;
	cin >> s2 ;     //??????? 
	i = 0 ;
	while (s1[i] != '\0')
		*p++ = s1[i++] - '0' ;  //????????? 
	wp = i ;     //a[]?????? 
	i = 0 ;
	while (s2[i] != '\0')
		*q++ = s2[i++] - '0' ;
	wq = i ;
	p-- ;  //?p??a[]?????? 
	q-- ;  //q?? 
	int jinwei = 0 ;  //?????????????????????????? 
	while (p >= a && q >= b)  //a,b????????? 
	{
		int temp ;
		temp = *p + *q + jinwei ;  //????????????????????????? 
		*p = temp % 10 ;    //?????????10 
		*q = *p ;
		jinwei = temp / 10 ;   //jinwei??????10 
		p-- ;     //????? 
		q-- ;	
	}
	if (wp >= wq)   //a????b 
	{
		while (p >= a)  //???b????a 
		{
			if (!jinwei) //???????????????? 
				break ;
			int temp ;   //???????? 
			temp = *p + jinwei ;
			*p = temp % 10 ;
			jinwei = temp / 10 ;
			p-- ;
		}
		if (jinwei)
		{
			cout << "1" ;  //??????????1????????????1 
			for (i = 0 ; a[i] != -1 ; i++)
				cout << a[i] ;  //??????? 
		}
		else
		{
			for (i = 0 ; a[i] == 0 ; i++);  //???????0??? 
			if (a[i] == -1)   //??0??????0
				cout << "0" ;
			else 
				for ( ; a[i] != -1 ; i++)
					cout << a[i] ;
		} 
	}
	else    //b????a?? 
	{
		while (q >= b)
		{
			if (!jinwei)
				break ;
			int temp ;
			temp = *q + jinwei ;
			*q = temp % 10 ;
			jinwei = temp / 10 ;
			q-- ;
		}
		if (jinwei)
		{
			cout << "1" ;
			for (i = 0 ; b[i] != -1 ; i++)
				cout << b[i] ;
		}
		else
		{
			for (i = 0 ; b[i] == 0 ; i++);
			if (b[i] == -1)
				cout << "0" ;
			else
				for ( ; b[i] != -1 ; i++)
					cout << b[i] ;
		} 
	}		
	return 0 ;		
}