semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{   int i,t,k ,j;
    char a[251],b[251],c[251] ;
    scanf("%s",a);
    scanf("%s",b);
    if(strlen(a)<strlen(b))
    {   
        t=strlen(b);
         k=strlen(b)-strlen(a);
         for (i=t-1;i>=0;i--)
         {
         if(i>k-1)  a[i]=a[i-k];
         else       a[i]='0';
         }
    }
                
                
    else 
     {   
        t=strlen(a);
         k=strlen(a)-strlen(b);
         for (i=t-1;i>=0;i--)
       {
         if(i>k-1)  b[i]=b[i-k];
         else       b[i]='0';
         }
    }
                
    
    
    
    
    for(i=t-1;i>0;i--)
    {    
         c[i]=a[i]+b[i]-'0';
         if((c[i]>='0')&&(c[i]<='9'))
        c[i]=c[i];
        else 
      {
       c[i]=c[i]-10;
        a[i-1]++;
        }
    }
      c[0]=a[0]+b[0]-'0';
       if(c[0]>'9')
       {
       c[0]=c[0]-10;
       printf("1");
       printf("%s\n",c);
       }
       else
    {   k=0;
        for(i=0;i<t;i++)
        {
        if(c[i]!='0')
        {
        for(j=i;j<t;j++)
        printf("%c",c[j]);
        k=1;
        }
       if(k==1)
       break;
        }
        k=0;
        for(i=0;i<t;i++)
        {if(c[i]!='0')
        k=k+1;
        }
        if(k==0)
        printf("0");
       
          return 0;
}
}
int main()
{
	char a[300],b[300],c[300];
	scanf("%s",a);
	scanf("%s",b);
	int t,a1,a2,i,j;
	a1=strlen(a);
	a2=strlen(b);
    if(a1<a2)
	{
		strcpy(c,a);
		strcpy(a,b);
		strcpy(b,c);
		t=a1;
		a1=a2;
		a2=t;
	}
	int d;
   for(i=a2-1,j=a1-1;i>0;i--,j--)
   {
	   d=a[j]+b[i]-'0'-'0';
	   a[j]=d%10+'0';
	   if(d>9)
	   a[j-1]++;
   }
   a[a1-a2]=a[a1-a2]+b[0]-'0';
   for(i=a1-a2;i>0;i--)
	   if(a[i]>'9')
	   {
		   a[i]=a[i]-10;
           a[i-1]++;
	   }
   if(a[0]>'9')
   {	   
	   a[0]=a[0]-10;
	   printf("1");
	   printf("%s",a);
   }
   else
   {
	   for(i=0;i<a1;i++)
		   if(a[i]!='0')
			   break; 
           if(i==a1)
             printf("0");
            else
             {
	   for(j=i;j<a1;j++)
	   printf("%c",a[j]);
               }
}
}
int max(int a,int b)
{
	if (a >= b)
		return a;
	else
		return b;
}
int main()
{
	int a[100000] ={0}, b[100000] = {0};
	char s1[100000], s2[1000000];
	
	scanf("%s%s",s1,s2);
	
	int len1 = 0, len2 = 0;
	len1 = strlen(s1);
	len2 = strlen(s2);
	//????????
	int j = 0;
	for (int i = len1 - 1; i >= 0; i--, j++)
		a[j] = s1[i] - '0';//?s1????????a?????????????????
	
	j = 0;
	for (int i = len2 - 1; i >= 0; i--, j++)
		b[j] = s2[i] - '0';
	
	int m = max(len1, len2);
	for (int i = 0; i < m; i++)
	{
		a[i] = a[i] + b[i];
		if (a[i] >= 10)
		{
			a[i] %= 10;
			a[i+1]++;
		}
	}
	int tag = 0;//????0?
	for (int i = m; i >= 0; i--)
	{
		if (a[i] != 0)
			tag = 1;
		if (tag == 1)
		{
			printf("%d",a[i]);
		}
		if (tag == 0 && i == 0)
			printf("0");
	}
	printf("\n");
	return 0;
}
char szline1[maxlen];
char szline2[maxlen];
int an1[maxlen];
int an2[maxlen];
int main()
{
	cin.getline(szline1, maxlen);
	cin.getline(szline2, maxlen);
	int len1 = strlen(szline1);
	int len2 = strlen(szline2);
	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;
}
int main()
{
	char s1[252], s2[252];
  int a[252],b[252],c[252];
 
  memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
	memset(c,0,252);
	cin.getline(s1,251);
  cin.getline(s2,251);
	
 int len1=strlen(s1),len2=strlen(s2);
 if((strcmp(s1,"0")==0&&strcmp(s2,"0")==0))
 { cout<<'0'<<endl;  return 0;}
 else
 {
 int i=0,j=0;
 for  (i = 0; i <len1; ++i) a[i]=s1[i]-'0';
 for (i=0;i<len2;++i) b[i]=s2[i]-'0';
 for( i=0;i<len1/2;i++)
{
	int temp;
	temp=a[i];
	a[i]=a[len1-1-i];
	a[len1-1-i]=temp;
}

  for( j=0;j<len2/2;j++)
{
	int temp;
	temp=b[j];
	b[j]=b[len2-1-j];
	b[len2-1-j]=temp;
}
 for(i=0;i<252;i++)
 {
	 a[i]+=b[i];
	 if(a[i]>=10)
	 {
	   a[i]-=10;a[i+1]++;
	 }
	 
 }
	i=251;
	 while(a[i]==0) i--;
	 for(;i>=0;i--) 
		 cout<<(char)(a[i]+'0');
	 cout<<endl;
 }
	 return 0;
 }
void c(char a[],int h,char b[],int k)
{
	int i,j,w=0,y=0;
	char c[252];
	for(i=h-1,j=k-1;i>=0;i--,j--)
	{
		if(j>=0)
		{
		c[i+1]=a[i]-48+b[j];
		if(c[i+1]>57)
		{
			c[i+1]=c[i+1]-10;
			if(i==0)
				c[i]='1';
			else
				a[i-1]=a[i-1]+1;
		}
		}
		else
		{
			if(a[i]>57)
			{c[i+1]=a[i]-10;
			if(i==0)
				c[i]='1';
			else
				a[i-1]=a[i-1]+1;}
			else
			c[i+1]=a[i];}
	}
	if(c[0]=='1')
	{
		for(i=0;i<h+1;i++)
			printf("%c",c[i]);
		printf("\n");}
	else
	{for(i=1;i<h+1;i++)
	{
        if(c[i]!='0')
		{w=1;y++;}
        if(h+1==2||y!=0)
		{printf("%c",c[i]);}}
	printf("\n");
	}
	
}

int main()
{
    int h,k;
	char a[251],b[251];
	scanf("%s%s",a,b);
	h=strlen(a);
	k=strlen(b);
	if(h>=k)
		c(a,h,b,k);
	else if(k>h)
		c(b,k,a,h);
	return 0;

}
void add(char* a,char* b,char* c)
{
	int i,j,k,max,min,n,temp;
	char*s,*pmax,*pmin;
	max=strlen(a);
	min=strlen(b);
	if(max<min)
	{
		temp=max;
		max=min;
		min=temp;
		pmax=b;
		pmin=a;
	}
	else
	{
		pmax=a;
		pmin=b;
	}
	   s=(char*)malloc(sizeof(char)*(max+1));
	  s[0]='0';
	   for(i=min-1,j=max-1,k=max;i>=0;i--,j--,k--)
	    s[k]=pmin[i]-'0'+pmax[j];
	   for(;j>=0;j--,k--)
	      s[k]=pmax[j];
       for(i=max;i>=0;i--)
        if(s[i]>'9')
        {
        	s[i]-=10;
        	s[i-1]++;
        }
        if(s[0]=='0')
        {
        	for(i=1;i<max+1;i++)
        	c[i-1]=s[i];
        	c[i-1]='\0';
        }
        else
        {
        	for(i=0;i<max+1;i++)
        	  c[i]=s[i];
        	  c[i]='\0';
        	  
        }
        free(s);
	
}

int main()
{
	char a[300],b[300],c[300];
	scanf("%s %s",a,b);
	if((a[0]=='0')&&(a[1]=='\0')&&(b[1]=='\0')&&(b[0]=='0')) printf("0");
	add(a,b,c);
	char*p,*p1;
	p=c;
	if((*p=='0')&&(*(p++)!='0')&&(strlen(c)>1)) p++;
	for(p1=p;p1<c+strlen(c);p1++)
	printf("%c",*p1);
	return 0;
}
int main()
{
	char a[260],b[260];
	int c[260]={0};
	int i;
	int la,lb;
	int t=0,s=0;
	int num(char c);
	gets(a);
	gets(b);
	la=strlen(a);
	lb=strlen(b);
	for(i=259;i>=259-la;i--)
		a[i]=a[la+i-259];
	for(i=259;i>=259-lb;i--)
		b[i]=b[lb+i-259];
	for(i=0;i<259-la;i++)
		a[i]='0';
	for(i=0;i<259-lb;i++)
		b[i]='0';
	for(i=258;i>=0;i--)
	{
		if(num(a[i])+num(b[i])+t>=10)
		{
			c[i]=num(a[i])+num(b[i])+t-10;
			t=1;
		}
		else
		{
			c[i]=num(a[i])+num(b[i])+t;
			t=0;
		}
	}
	for(i=0;i<=258;i++)
	{
		if(c[i]!=0)
			s=1;
		if(s==1)
			printf("%d",c[i]);
	}
	if(s==0)
		printf("%d",s);
	printf("\n");
	return 0;
}

int num(char c)
{
	int n;
	n=c-'0';
	return n;
}
main()
{
      int n1,n2,i,j=0,k,a,b;
      char str1[252],str2[252],str3[252];
      scanf("%s",str1);
      scanf("%s",str2);
      if(str1[0]=='0'&&str1[1]=='\0')printf("%s",str2);
      else{
      for(a=0;a<250;a++){
      if(str1[a]=='0'){
      for(i=0;i<250;i++)
      str1[i]=str1[i+1];}
      else break;}
      for(a=0;a<250;a++){
      if(str2[a]=='0'){
      for(i=0;i<250;i++)
      str2[i]=str2[i+1];}
      else break;}
      n1=strlen(str1);
      n2=strlen(str2);
      if(n1>n2){
      for(i=1;(n1-i)>=0;i++){
      if(n2-i<0)b=48;
      else b=str2[n2-i];
      if((str1[n1-i]+b+j)<=105){
      str3[n1-i]=str1[n1-i]+b-48+j;
      j=0;}
      else{str3[n1-i]=str1[n1-i]+b-58+j;
      j=1;}}
      if(j==1){
      for(k=0;n1-k>0;k++)
      str3[n1-k]=str3[n1-k-1];
      str3[0]=49;
      str3[n1+1]='\0';}
      else str3[n1]='\0';
      printf("%s",str3);
      }
      else{
      for(i=1;(n2-i)>=0;i++){
      if(n1-i<0) b=48;
      else b=str1[n1-i];
      if((str2[n2-i]+b+j)<=105){
      str3[n2-i]=str2[n2-i]+b-48+j;
      j=0;}
      else{str3[n2-i]=str2[n2-i]+b-58+j;
      j=1;}}
      if(j==1){
      for(k=0;n2-k>0;k++)
      str3[n2-k]=str3[n2-k-1];
      str3[0]=49;
      str3[n2+1]='\0';}
      else str3[n2]='\0';
      printf("%s",str3);
      }}
}
int main()
{
	char a[250],b[250],c[250];
	int i,j=0,k;
	int numa=0,numb=0;
	int ca,cb,cc,cy;
	char m[10]={'0','1','2','3','4','5','6','7','8','9'};
	gets(a);
	gets(b);
	for(i=0;a[i];i++)
		numa++;
	for(i=0;b[i];i++)
		numb++;
	if(numa>=numb)
	{
		for(i=numa-1;i>=(numa-numb);i--)
	b[i]=b[i-numa+numb];
	for(i=0;i<(numa-numb);i++)
		b[i]='0';
	}
    if(numa<numb)
	{
		for(i=numb-1;i>=(numb-numa);i--)
	a[i]=a[i-numb+numa];
	for(i=0;i<(numb-numa);i++)
		a[i]='0';
	numa=numb;
	}
	
    for(i=0;i<=numa;i++)
		c[i]='0';
    for(i=numa-1;i>=0;i--)
	{ca=a[i]-'0';
	cb=b[i]-'0';
	cc=ca+cb;
	cy=c[i+1]-'0';
	if(cc+cy<10)
		c[i+1]=m[cc+cy];
	if(cc+cy>=10)
	{c[i]='1';
	c[i+1]=m[cc+cy-10];}
	}
	for(i=0;i<=numa;i++)
	{	if(c[i]=='0')
	j++;
	}
	if(j==numa+1)
		printf("0\n");
	else
	{
		for(i=0;i<=numa;i++)
		{	if(c[i]!='0')
		{k=i;
		break;}
		}
        for(i=k;i<=numa;i++)
	    printf("%c",c[i]);
	}
	return 0;
}
int an1[255];
int an2[255];
char s1[255];
char s2[255];
int main()
{
cin>>s1;cin>>s2;
int i, j;
int nLen1,nLen2;
for(i=0;i<255;i++)
{
	an1[i]=0;
	an2[i]=0;
}
for(i=0;i<255;i++)
{
	if(s1[i]=='\0')
	{nLen1=i;break;}
}
for(i=0;i<255;i++)
{
	if(s2[i]=='\0')
	{nLen2=i;break;}
}
j = 0;
for( i = nLen1 - 1;i >= 0 ; i --)
an1[j++] = s1[i] - '0';   
j = 0;
for( i = nLen2 - 1;i >= 0 ; i --)
an2[j++] = s2[i] - '0';
for( i = 0;i <255; i ++ ) {
an1[i] += an2[i];
if( an1[i] >= 10 ) {       
an1[i] -= 10;
an1[i+1] ++;
}
}
int a=0;
for(i=255;i>=0;i --) 
{
        if(i==0)
{
          cout<<an1[i];
break;}
	if(an1[i]==0&&a==0)
		continue;
	if(an1[i]!=0)
	{
	a=1;
	}
	cout<<an1[i];
}
 return 0;
}
int an1[MAX_LEN];
int an2[MAX_LEN];
char szline1[MAX_LEN];
char szline2[MAX_LEN];

int main()
{
	scanf("%s",szline1);
	scanf("%s",szline2);

	int i,j;
	int maxlen;
	memset(an1,0,sizeof(an1));
	memset(an2,0,sizeof(an2));

	int len1,len2;
	len1 = strlen(szline1);
	len2 = strlen(szline2);
	for(j = 0,i = len1 - 1; i >= 0; i --)
		an1[j++] = szline1[i] - '0';
	for(j = 0,i = len2 - 1; i >= 0; i --)
		an2[j++] = szline2[i] - '0';

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

	int startpos = 0;
	for(i = 0; i < maxlen; i ++)
	{
		if(an1[i]+an2[i] >= 10)
		{
			an1[i] = an1[i] + an2[i] - 10;
			an1[i+1] ++;
		}
		else
			an1[i] += an2[i];
		if(an1[i])
			startpos = i;
	}
	if(an1[i])
		startpos = i;
	if(startpos == 0)
		printf("0");
	else
	{
		for(i = startpos;i >=0; i--)
			printf("%d",an1[i]);
	}
	printf("\n");
	return 0;
}
main()
{
	char a[250],b[250];
	int x[250],y[250],z[251]={0},i,j,m,n;
	gets(a);
	gets(b);
	m=strlen(a);
	n=strlen(b);
	for(i=0;i<=249;i++)
	{
		if(i<=249-m)
			x[i]=0;
		else
			x[i]=a[i-250+m]-'0';
	}
	for(i=0;i<=249;i++)
	{
		if(i<=249-n)
			y[i]=0;
		else
			y[i]=b[i-250+n]-'0';
	}
	for(i=249;i>=0;i--)
	{
		if(x[i]+y[i]+z[i+1]>=10)
		{
			z[i+1]=x[i]+y[i]+z[i+1]-10;
			z[i]=1;
		}
		else z[i+1]=x[i]+y[i]+z[i+1];
	}
	j=0;
	for(i=0;i<=250;i++)
	{
		if(z[i]!=0) 
		break;
		j=j+1;
	}
		for(;i<=250;i++)
			printf("%d",z[i]);
	if(j==251) printf("0");
}
int a[200];
int b[200];
int out[200]; 
void init(){
     for(int i=0;i<200;i++){
             a[i]=0;
             b[i]=0;
             out[i]=0;
     }
}        
void load(){
     char temp[201];
     cin>>temp;
     int begin = 200 - strlen(temp);
     for(int i=0;i<strlen(temp);i++){
             a[begin+i]=temp[i]-'0';
     }
     cin>>temp;
     begin = 200 - strlen(temp);
     for(int i=0;i<strlen(temp);i++){
             b[begin+i]=temp[i]-'0';
     }
}
void add(){
     int carry = 0;
	 int i=0;
     for(i=199;i>=0;i--){
             out[i] = a[i] + b[i] + carry;
             if(out[i]>=10){
				 out[i]-=10;
                 carry = 1;
             }
			 else
				 carry =0;
	 }
     for(i=0;i<199;i++){
		 if(out[i]!=0)
         break;
	 }
     for(;i<200;i++){
		 cout<<out[i];
	 }
	 cout<<endl;
}
int main(){
    init();
    load();
    add();
    return 0;
}
int main()
{
   char str1[251]={'0'},str2[251]={'0'},jin='0';
   int a,b,i,flag=0;
   scanf("%s",&str1);
   scanf("%s",&str2);
   if (str1[0]=='0' && str2[0]=='0' && strlen(str1)==1 && strlen(str2)==1)
   {
       printf("0");
       return 0;
   }
   if (strlen(str1)>=strlen(str2))
   {
       a=strlen(str1); b=strlen(str2);
       for (i=a-1;i>=0;i--)  str2[i]=str2[i-a+b];
       for (i=0;i<a-b;i++) str2[i]='0';
   }
   else
   {
       a=strlen(str2); b=strlen(str1);
       for (i=a-1;i>=0;i--)  str1[i]=str1[i-a+b];
       for (i=0;i<a-b;i++) str1[i]='0';
   }
   for (i=a-1;i>=0;i--)
   {
       str1[i]=str1[i]+str2[i]+jin-'0'-'0';
       jin='0';
       if (str1[i]>'9')
       {
           jin='1';
           str1[i]=str1[i]-(':'-'0');
       }
   }
   if (jin=='1')
   {
       printf("1");
       for(i=0;i<=a-1;i++) printf("%c",str1[i]);
   }
   else
   {
       for(i=0;i<=a-1;i++)
       {
           if(str1[i]=='0' && flag==0) continue;
           else
           {
               flag=1;
               b=i;
           }
           break;
       }
   for(i=b;i<=a-1;i++) printf("%c",str1[i]);
   }
   return 0;
}
main()
{
      char str1[250];
      char str2[250];
      char str3[250];
      char str4[251];
      char str5[251];
      int a,b,c,n,i;
      scanf("%s%s",str1,str2);
      for(i=0;i<250;i++)
      { 
          a=i;
          if(str1[i]==0)
          break;      
      }
      for(i=0;i<250;i++)
      {
          b=i;
          if(str2[i]==0)
          break;       
      }
      if(a>b)
      {
            n=a;
            for(i=(a-1);i>=0;i--)
            {
                  if(i<(a-b))
                  str2[i]='0';
                  else
                  str2[i]=str2[i-(a-b)];
            }          
      }
      if(b>a)
      {
            n=b;
            for(i=(b-1);i>=0;i--)
            {
                  if(i<(b-a))
                  str1[i]='0';
                  else
                  str1[i]=str1[i-(b-a)];
            }          
      }
      if(b==a)
      n=a;
      for(i=(n-1);i>=0;i--)
      {
           str3[i]=str1[i]+str2[i]-'0'-'0';
      }
      for(i=(n-1);i>0;i--)
      {
           if(str3[i]>9)
             {
                  str4[i+1]=str3[i]-10;
                  str3[i-1]=str3[i-1]+1;
             }
           else
             str4[i+1]=str3[i];             
      } 
      if(str3[0]>9)
      {
           str4[1]=str3[0]-10;
           str4[0]=1;         
      }
      else
      {
          str4[1]=str3[0];
          str4[0]=0;
      }
      int f=0;
      for(i=0;i<=n;i++)
      {
          c=i;
          if(str4[i]!=0)
          break;
      }
      for(i=c;i<=n;i++)
      {
          printf("%d",str4[i]);
          f=1;
      }
      if(f==0)
      printf("%d",f);
      
}
typedef int data;
struct node;
typedef struct node* pnode;
struct node
{
  data value;
  pnode pnext;
};
void node_create(pnode *pheader,int l,char a[length],int max)
{
  pnode p=*pheader;
  p->pnext=NULL;
  for(int i=0;i<l;i++)
  {
     pnode pnew=(pnode)malloc(sizeof (struct node));
     pnew->value=a[i]-'0';
     pnew->pnext=p->pnext;
     p->pnext=pnew;
     p=*pheader;
  }
  for(int i=0;i<l;i++) p=p->pnext;
  for(int i=l-1;i<=max;i++) 
  {
     pnode pnew=(pnode)malloc(sizeof (struct node));
     pnew->value=0;
     pnew->pnext=p->pnext;
     p->pnext=pnew;
     p=p->pnext;
  }
}
void node_plus(pnode pheader1,pnode pheader2,pnode* pheader3,int max)
{
   int sum,num=0;
   pnode p1=pheader1->pnext;
   pnode p2=pheader2->pnext;
   pnode p3=(*pheader3)->pnext;
   for(int i=0;i<=max;i++)
   {
         sum=p1->value+p2->value+num;
         if(sum<10) {p3->value=sum;num=0;}
         else {p3->value=sum-10;num=1;}
         p1=p1->pnext;
         p2=p2->pnext;
         p3=p3->pnext;
   }
}

void output(pnode pheader3,int l)
{
  int t;
  pnode p=pheader3;
  int a[length]={0};
  for(int i=0;i<l;i++)
  {p=p->pnext;a[i]=p->value;}
  for(int i=l-1;i>=0;i--) {if(a[i]!=0) {t=i;break;}}
  for(int i=t;i>=0;i--) {printf("%d",a[i]);}
}
main()
{
   struct node header1,header2,header3;
   pnode pheader1=&header1;
   pnode pheader2=&header2;
   pnode pheader3=&header3;
   int l1,l2;
   int max;
   char a1[length]={'\0'},a2[length]={'\0'},a3[length+1]={'\0'};
   for(int i=0;i<length+1;i++) {a3[i]='0';}
   gets(a1);
   l1=strlen(a1);
   gets(a2);
   l2=strlen(a2);
   if(l1>=l2) max=l1+1;
   else max=l2+1;
   node_create(&pheader1,l1,a1,max);
   node_create(&pheader2,l2,a2,max);
   node_create(&pheader3,max,a3,max);
   node_plus(pheader1,pheader2,&pheader3,max);
   output(pheader3,max);

   getchar();
   getchar();
}
/*
 * wanyi.cpp
 *
 *  Created on: 2012-11-21
 *      Author: 7
 */
char c[300];
void change(char a[250],char b[250],int la,int lb)
{
	int sig=1;
	c[la]=a[la-1];
	if(lb>0)
		{
			c[la]=a[la-1]+b[lb-1]-'0';
		}
	if(c[la]>'9')
	{
		c[la]=c[la]-10;
		if(la>1)
		a[la-2]+=1;
		else
			c[0]='1';
	}
	if(la>1)
	change(a,b,la-1,lb-1);
	else
	{
		for(int i=0;i<(int)strlen(c);i++)
			{
			if(sig&&c[i]=='0')
				{continue;}
			else {cout<<c[i];sig=0;}
			}
		if(sig)
			cout<<0;
	}
}
int main()
{
	memset(c,'\0',sizeof(c));
	c[0]='0';
	char a[300];
	char b[300];
	cin.getline(a,250,'\n');
	cin.getline(b,250,'\n');
	if(strlen(a)>strlen(b))change(a,b,strlen(a),strlen(b));
	else change(b,a,strlen(b),strlen(a));
}
int str2bigint(char *str,int *a)
{
	int len=(int)strlen(str);
	int i;
	for(i=0;i<len;i++)
		a[len-i-1]=str[i]-'0';
	return len;
}

void print_bigint(int *a,int len)
{
	int k=len-1;
	int i;
	while(a[k]==0&&k>0)
		k--;
	for(i=k;i>=0;i--)
		printf("%d",a[i]);
}

int add(int *a,int alen,int *b,int blen,int *c)
{
	int i;
	int len=(alen>blen)?alen:blen;
	for(i=0;i<len;i++)
	{
		c[i]=0;
		if(i<alen)
			c[i]+=a[i];
		if(i<blen)
			c[i]+=b[i];
	}
	c[len]=0;
	for(i=0;i<len;i++)
	{
		if(c[i]>=10)
		{
			c[i+1]+=c[i]/10;
			c[i]%=10;
		}
	}
	return c[len]?(len+1):len;
}

void main()
{
	char s1[max],s2[max];
	int a[max],b[max],c[max];
	int alen,blen,clen;
	scanf("%s%s",s1,s2);
	alen=str2bigint(s1,a);
	blen=str2bigint(s2,b);
	clen=add(a,alen,b,blen,c);
	print_bigint(c,clen);
}
int main()
{
	char a[210]={0},b[210]={0};
	int len_a,len_b,c[210]={0},d[210]={0},i,j,max;
	cin>>a>>b;
	len_a=strlen(a);
	len_b=strlen(b);
	j=0;
	for(i=len_a-1;i>=0;i--)
		c[j++]=a[i]-'0';
	j=0;
	for(i=len_b-1;i>=0;i--)
		d[j++]=b[i]-'0';
	max=(len_a>len_b)?len_a:len_b;
	for(i=0;i<max;i++)
	{
		c[i]+=d[i];
		if(c[i]>9)
		{
			c[i+1]++;
			c[i]-=10;
		}
	}
	for(i=max+1;i>=0;i--)
		if(c[i]!=0)
			break;
	if(i==-1)cout<<c[0];
	for(j=i;j>=0;j--)
		cout<<c[j];
	return 0;
}
int main()

{
	
char s1[251],s2[251];
int sum[251];
int flag=0;
	


int i,j,k;

int len1,len2;

int min,max;

memset(s1,0,sizeof(s1));
memset(s2,0,sizeof(s2));
cin.getline(s1,sizeof(s1));
cin.getline(s2,sizeof(s2));

memset(sum,0,sizeof(sum));




len1=strlen(s1);
len2=strlen(s2);


min=(len1>len2)? len2:len1;
max=(len1>len2)? len1:len2;


for(i=min-1;i>=0;i--)
{
    sum[max-(min-1-i)]=s2[len2-1-(min-1-i)]-'0'+s1[len1-1-(min-1-i)]-'0';

}

if(max==len1)
{
for(i=max-min;i>=1;i--)
{
	sum[i]=s1[i-1]-'0';
}
}else{
	for(i=max-min;i>=1;i--)
{
	sum[i]=s2[i-1]-'0';
}
}



for(i=max;i>=1;i--)
{
	sum[i-1]=sum[i-1]+sum[i]/10;
	sum[i]=sum[i]%10;
}
j=0;
while(sum[j]==0 && j<=max)
{
	j++;


}

if(sum[j]!=0)
{
    for(i=j;i<=max;i++)
	{
		cout<<sum[i];
	}
}

else{
	cout<<0;
}











	return 0;

}
void main()
{
	char a[260],b[260],c[260];
	int m,i,n;
	gets(a);
	gets(b);
	m=strlen(a)-strlen(b);
	if(m>0)
	{
		for(i=strlen(b);i>=0;i--)
			b[i+m]=b[i];
		for(i=m-1;i>=0;i--)
			b[i]=48;
	}
	if(m<0)
	{
		for(i=strlen(a);i>=0;i--)
			a[i-m]=a[i];
		for(i=-m-1;i>=0;i--)
			a[i]=48;
	}
	n=strlen(a);
	for(i=0;i<n;i++)
		c[i]=48;
	c[n]='\0';
	for(i=n-1;i>0;i--)
	{
		c[i]=c[i]+a[i]+b[i]-96;
		if(c[i]>57)
		{
			c[i]=c[i]-10;
			c[i-1]++;
		}
	}
	c[0]=c[0]+a[0]+b[0]-96;
	if(c[0]>57)
	{
		c[0]=c[0]-10;
		for(i=n;i>=0;i--)
			c[i+1]=c[i];
		c[0]=49;
	}
    while(c[0]==48)
	{
		for(i=0;i<=strlen(c);i++)
			c[i]=c[i+1];
	}
	if(c[0]=='\0')printf("0");
	else
	printf("%s",c);
}
int max(int x,int y)
{
	return (x>y)?x:y;
}
int min(int x,int y)
{
	return (x<y)?x:y;
}
void main()
{
	int a[251],b[251],c[250]={0},i,j,k=0,x,y;
	char m[250],n[250];
	scanf("%s",m);
	scanf("%s",n);
    x=strlen(m);
	y=strlen(n);
	for(i=0;i<x;i++)
	{
		a[i+1]=m[i]-48;
	}
	for(i=0;i<y;i++)
	{
		b[i+1]=n[i]-48;
	}
	if(x>y)
	{
		for(i=1;i<=x;i++)
			c[i]=a[i];
	}
	else
	{
		for(i=1;i<=y;i++)
			c[i]=b[i];
	}
	c[0]=0;
	for(i=0;i<min(x,y);i++)
	{
		if(a[x-i]+b[y-i]+k<10) 
		{
			c[max(x,y)-i]=a[x-i]+b[y-i]+k;
			k=0;
		}
		else 
		{
			c[max(x,y)-i]=(a[x-i]+b[y-i]+k)%10;
			k=1;
		}
	}
	c[max(x,y)-i]+=k;
	for(i=max(x,y);i>0;i--)
	{
		if(c[i]>=10)
		{	
			c[i]=(c[i]%10);
			c[i-1]+=1;
		}
	}
	for(i=0;;i++)
		if(c[i]) break;
	for(j=i;j<=max(x,y);j++)
		printf("%d",c[j]);
	if(i>max(x,y)) printf("0");
	printf("\n");
}
int main()
{
    char str1[299],str2[388];
    gets(str1);
    gets(str2);
    char sum[289];
    long int i=strlen(str1)-1,j=strlen(str2)-1;
    int k=0;
    for(;i>=0&&j>=0;i--,j--,k++)
    {
        sum[k]=str1[i]-'0'+str2[j];
    }
    if(strlen(str1)>strlen(str2))
    {
        for(;i>=0;i--)
        {
            sum[k]=str1[i];
            k++;
        }
    }
    else{
        for(;j>=0;j--)
        {
            sum[k]=str2[j];
            k++;
        }
    }
    for(int m=0;m<k-1;m++)
    {
        if(sum[m]>'9')
        {
            sum[m]=(char)(sum[m]-10);
            sum[m+1]=(char)(sum[m+1]+1);
        }
    }
    
    if(sum[k-1]>'9')
    {
        sum[k]='1';
        sum[k-1]-=10;
        int p=k;
        while(sum[p]=='0'&&p>0)
            p--;
        for(;p>=0;p--)
            cout<<sum[p];
        cout<<endl;
    }
    else{
        int p=k-1;
        while(sum[p]=='0'&&p>0)
            p--;
        for(;p>=0;p--)
            cout<<sum[p];
        cout<<endl;
    }

    return 0;
    

    
}
int a[1000],b[1000],c[1000];
char n1[1000],n2[1000];
int i,j,k,l,m,n,xys,ysc;
int main()
{
    gets(n1);
    gets(n2);
    a[0]=strlen(n1);
    for (i=1;i<=a[0];++i) a[i]=n1[a[0]-i]-'0';
    b[0]=strlen(n2);
    for (i=1;i<=b[0];++i) b[i]=n2[b[0]-i]-'0';
    int len=max(a[0],b[0]);
    j=0;
    for (i=1;i<=len;++i){
        c[i]=a[i]+b[i]+j;
        j=c[i]/10;
        c[i]=c[i]%10;
    }
    c[0]=len;
    if (j>0) c[++c[0]]=j;
    while (c[c[0]]==0&&c[0]>1) --c[0];
    for (i=c[0];i>0;--i) printf("%d",c[i]);
    return 0;
}
/*
 * add large number.cpp
 *??:?????
 *  Created on: 2012-11-27
 *      Author: ???
 */


char num1[260];
char num2[260];
char result[260];
int len1,len2;
void add();
int main ()
{

	cin.getline(num1,250);
	cin.getline(num2,250);
	len1=strlen(num1);
	len2=strlen (num2);
    add();
    return 0;
}

void add()
{
	if(len1>len2)
	{
		int i=0;
	    for(i=0;i<len2;i++)
	   {
		result[len1-i]=result[len1-i]+num1[len1-1-i]+num2[len2-1-i]-48;
		if(result[len1-i]>57)
			{
			result[len1-i]=result[len1-i]-10;
			result[len1-i-1]++;
			}
	   }
	    for(i=len2;i<len1;i++)
	    {
	    	result[len1-i]=result[len1-i]+num1[len1-i-1];
	    	if(result[len1-i]>57)
	    			{
	    			result[len1-i]=result[len1-i]-10;
	    			result[len1-i-1]++;
	    			}
	    }
        for(i=0;i<=len1;i++)
        	if(result[i]!='0'&&result[i]!='\0')
        		break;
            if(i==len1)
               cout<<result[1];
            else{
        if(48<result[i]&&result[i]<=57)
    	            	;
    	        else
    	       result[i]=result[i]+48;
        for(i=i;i<=len1;i++)
        	cout<<result[i];}
	}
	else
	{
		int i=0;
	    for(i=0;i<len1;i++)
	   {
		result[len2-i]=result[len2-i]+num1[len1-1-i]+num2[len2-1-i]-48;
		if(result[len2-i]>57)
			{
			result[len2-i]=result[len2-i]-10;
			result[len2-i-1]++;
			}
	   }
	    for(i=len1;i<len2;i++)
	    {
	    	result[len2-i]=result[len2-i]+num2[len2-i-1];
	    	if(result[len2-i]>57)
	    			{
	    			result[len2-i]=result[len2-i]-10;
	    			result[len2-i-1]++;
	    			}
	    }
	    for(i=0;i<len2;i++)
	           	if(result[i]!='0'&&result[i]!='\0')
	           		break;
	            if(i==len2)
	                   cout<<result[1];
	            else
	            	{if(48<result[i]&&result[i]<=57)
	            	;
	            else
	            	result[i]=result[i]+48;
	           for(i=i;i<=len2;i++)
	           	cout<<result[i];}
	}
}