semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	char a[20][101],b[20][101],c[20][101];
    int w,x,i,m,carry,lena[20],lenb[20],jump;
	scanf("%d",&w);
	for(x=0;x<w;x++)
    {
		scanf("%s",a[x]);
	    lena[x]=strlen(a[x]);
        scanf("%s",b[x]);
	    lenb[x]=strlen(b[x]);
	}
	for(x=0;x<w;x++)
	{
      a[x][100]='\0';jump=99-lena[x];
	  for(m=lena[x];m>0;m--)
		a[x][m+jump]=a[x][m-1];
      b[x][100]='\0';jump=99-lenb[x];
	  for(m=lenb[x];m>0;m--)
		b[x][m+jump]=b[x][m-1];
      carry=0;
	  for(m=99;m>99-lenb[x];m--)
		if(a[x][m]-carry<b[x][m])
		{
			c[x][m]=a[x][m]-b[x][m]+10-carry+'0';
			carry=1;
		}
		else
		{
			c[x][m]=a[x][m]-b[x][m]-carry+'0';
			carry=0;
		}
    c[x][99-lenb[x]]=a[x][99-lenb[x]]-carry;
	for(m=98-lenb[x];m>99-lena[x];m--)
		c[x][m]=a[x][m];
	for(m=99-lena[x]+1;m<100;m++)
		printf("%c",c[x][m]);
	printf("\n");
	}
}
void main()
{
	int n,i,j,La,Lb;
	char A[100],B[100],C[30][100];
	scanf("%d\n",&n);
	for (i=0;i<=n-1;i++)
	{
		gets(A);
		gets(B);
		getchar();
		La=strlen(A);
		Lb=strlen(B);
		for (j=Lb-1;j>=0;j--)
		{
			A[La-Lb+j]=A[La-Lb+j]-B[j];
			if (A[La-Lb+j]<0)
			{
				A[La-Lb+j]+=10;
				A[La-Lb+j-1]-=1;
			}
			A[La-Lb+j]+=48;
		}
		strcpy(C[i],A);
	}
	for (i=0;i<=n-1;i++) puts(C[i]);
}
/********************************************
 *@file   4.cpp                             *
 *@author ??                              *
 *@date   2013-11-19                        *
 *@description                              *
 *??????8??????                 *
 ********************************************
 */
int main()
{
	int n, i, p, q, nlen1, nlen2;
	int num1[101], num2[100];
	char str1[101], str2[101];
	cin >> n;
	for (i = 0; i < n; i++) // ????
	{	
		cin.get();
		cin.getline(str1, 101);
		cin.getline(str2, 101);
		//?????
		nlen1 = strlen(str1);
		nlen2 = strlen(str2);
		memset(num1, 0, sizeof(num1)); // ????
		memset(num2, 0, sizeof(num2)); // ????
		q = 0;

		//????
		for (p = nlen1 - 1; p >= 0; p--)
			num1[q++] = str1[p] - '0';
		q = 0;
		for (p = nlen2 - 1; p >= 0; p--)
			num2[q++] = str2[p] - '0';

		//???
		for (p = 0; p < 100; p++)
		{
			num1[p] -= num2[p];
			if (num1[p] < 0)
			{
				num1[p] += 10;
				num1[p+1]--;
			}
		}
		p = 100;

		//??0?
		while (num1[p] == 0)
			p--;

		//????
		for ( ; p >= 0; p--)
			cout << num1[p];
		if (i != n - 1 )
			cout << endl;
	}
	return 0;
}
int main()
{
	char a[150],b[150];
	int c[150],d[150],result[150];
	int n,la,lb,i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",a);
		scanf("%s",b);
		la=strlen(a);
		lb=strlen(b);
		for(j=0;j<la;j++)
			c[j]=a[j]-'0';
		for(j=0;j<la-lb;j++)
			d[j]=0;
		for(j=la-lb;j<la;j++)
			d[j]=b[j-la+lb]-'0';

		int carry = 0;
		for(j=la-1;j>=0;j--)
		{
			if(c[j]>=d[j]+carry)
			{
				result[j]=c[j]-d[j]-carry;
				carry = 0;
			}
			else 
			{
				//c[j-1]=c[j-1]-1;
				
				result[j]=c[j]+10-d[j]-carry;
				carry = 1;
			}
		}
		for(j=0;j<la;j++)
		{
			if(result[j]!=0) break;
		}
		for(k=j;k<la-1;k++)
			printf("%d",result[k]);
		printf("%d\n",result[la-1]);
	}
	return 0;
}
void main()
{
	int n;char a[102],b[102],c[10][102];int i,j,k,m,v,x;
	scanf("%d",&n);
	for(x=0;x<n;x++)
	{
		getchar();
		for(m=0;m<102;m++)
			c[x][m]='0';
		for(i=0;i<102;i++)
		{
			a[i]=getchar();
			if(a[i]=='\n') break;
        }		
	    for(j=0;j<102;j++)
		{
			b[j]=getchar();
			if(b[j]=='\n') break;
		}
		for(k=101;k+i-101>=0;k--)
			a[k]=a[k+i-101];
		for(k=0;k<101-i;k++)
			a[k]='0';
		for(k=101;k+j-101>=0;k--)
			b[k]=b[k+j-101];
		for(k=0;k<101-j;k++)
			b[k]='0';//?a?b?????
		for(k=0;k<=101;k++)
		{
			if (a[k]!=b[k]) break;//?a,b?????????,????
		}
		for(m=100;m>=0;m--)
		{
				if(a[m]<b[m])
				{
					c[x][m]=a[m]+58-b[m];
					a[m-1]=a[m-1]-1;//??
				}
				else c[x][m]=a[m]+48-b[m];
		}	
		for(i=0;i<102;i++)
			a[i]='0';
		for(j=0;j<102;j++)			
			b[i]='0';//??????a?b?0
	}
    for(x=0;x<n;x++)
	{	
	    for(k=0;k<=101;k++)
		{
			if(c[x][k]!='0') break;
		}
		for(m=k;m<=100;m++) 
			printf("%c",c[x][m]);//??
	    for(k=0;k<=100;k++)
			v=v+c[x][k];
	    if (v==48) printf("0");
		printf("\n");
	}
}
int main()
{
	int n,i,j;
	cin>>n;
	cin.get();
	for(i=1;i<=n;i++)
	{
		char str1[1000],str2[1000],str3[1000],str4[1000];
		cin.getline(str1,900);
		cin.getline(str2,900);
		int a=strlen(str1);
		int b=strlen(str2);
		for(j=0;j<a;j++)
		{
			str3[j]=str1[a-j-1];
		}
		for(j=0;j<b;j++)
		{
			str4[j]=str2[b-j-1];
		}
		for(j=0;j<b;j++)
		{
			if(str3[j]>=str4[j])
				str3[j]=str3[j]-str4[j]+'0';
			else
			{
				str3[j]=10+str3[j]-str4[j]+'0';
				str3[j+1]--;
			}
		}
		for(j=a-1;j>=0;j--)cout<<str3[j];
                cout<<endl;
                cin.get();
	}
	return 0;
}
// ??
// ????wayne
// ?????12.30


int main()
{
	char a[250],b[250];
	int a1[250],b1[250],c[250],i,j,n,k;
	cin>>n;
	
	for(k=0;k<n;k++)
	{
	for(i=0;i<250;i++)
	{
		a1[i]=0;
		b1[i]=0;
		c[i]=0;
	}
	cin.get();
	cin.getline(a,250);
	cin.getline(b,250);
	for(i=strlen(a)-1,j=0;i>=0;i--,j++)
		a1[j]=a[i]-'0';
	for(i=strlen(b)-1,j=0;i>=0;i--,j++)
		b1[j]=b[i]-'0';
	if(strlen(a)>strlen(b))
	{
		for(i=0;i<strlen(a);i++)
		{
			c[i]+=a1[i]-b1[i];
			if(c[i]<0)
			{
				c[i]=10+c[i];
				c[i+1]--;
			}
		}
		while(c[i]==0&&i>0)
			i--;
		for(;i>=0;i--)
			cout<<c[i];
		cout<<endl;
	}
	else if(strlen(a)<strlen(b))
	{
		for(i=0;i<strlen(b);i++)
		{
			c[i]+=b1[i]-a1[i];
			if(c[i]<0)
			{
				c[i]=10+c[i];
				c[i+1]--;
			}
		}
		while(c[i]==0&&i>0)
			i--;
		for(;i>=0;i--)
			cout<<c[i];
		cout<<endl;
	}
	else
	{
		for(i=strlen(a)-1;i>=0;i--)
		{
			if(a1[i]==b1[i])
				continue;
			else if(a1[i]>b1[i])
			{
				for(i=0;i<strlen(a);i++)
				{
					c[i]+=a1[i]-b1[i];
					if(c[i]<0)
					{
						c[i]=10+c[i];
						c[i+1]--;
					}
				}
				while(c[i]==0&&i>0)
					i--;
				for(;i>=0;i--)
					cout<<c[i];
				cout<<endl;
				break;
			}
			else
			{
				for(i=0;i<strlen(b);i++)
				{
					c[i]+=b1[i]-a1[i];
					if(c[i]<0)
					{
						c[i]=10+c[i];
						c[i+1]--;
					}
				}
				while(c[i]==0&&i>0)
					i--;
				for(;i>=0;i--)
					cout<<c[i];
				cout<<endl;
				break;
			}
		if(i==0)
			cout<<"0"<<endl;
		}
	}
	}
	return 0;
}
int main()
{
	int n , i , k , t , z , b , a , len1 , len2 ;
	char num1[1000][100] , num2[1000][100] ;
	cin >> n ;
	cin.get() ;
	for ( i = 0 ; i < n ; i++ )
	{
		cin >> num1[i] >> num2[i] ;
	}
	for ( i = 0 ; i < n ; i++ )
	{
		len1 = strlen(num1[i]) ;
		len2 = strlen(num2[i]) ;
		for ( k = 0 ; k < len2 ; k++ )
		{
			a = len1-k-1 ;
			b = len2-k-1 ;
			if ( num1[i][a] >= num2[i][b] )
			{
				num1[i][a] = num1[i][a] - num2[i][b] + '0';
			}
			else
			{
				for ( t = a - 1 ; t >= 0 ; t-- )
					if ( num1[i][t] > '0' )
						break ;
				for ( z = t + 1 ; z <= a - 1 ; z++ )
					if ( num1[i][z] == '0' )
						num1[i][z] = '9' ;
				num1[i][t] = num1[i][t] - '1' + '0' ;
				num1[i][a] = num1[i][a] + '1' - '0' + '9' - '0' - num2[i][b] + '0' ;
			}
		}
		while ( 1 ) 
		{
			if ( num1[i][0] != '0' )
				break ;
			else
			{
				for ( z = 0 ; z < len1 ; z++ )
				{
					num1[i][z] = num1[i][z+1] ;
				}
				len1-- ;
			}
		}
		for ( k = 0 ; k < len1 ; k++ )
			cout << num1[i][k] ;
		cout << endl ;
	}
	cin.get() ;
	cin.get() ;
	return 0 ;
}
int main()
{
	int n,i,leng_a,leng_b,tag=0,a[128],b[128];
	char s1[128],s2[128];
	scanf("%d",&n);
	while(n--)
	{
		for(i=0;i<128;i++)
		{
			a[i]=0;
			b[i]=0;
		}
		scanf("%s%s",s1,s2);
		leng_a=strlen(s1);
		leng_b=strlen(s2);
		for(i=0;i<leng_a;i++)
			a[i]=s1[leng_a-i-1]-'0';
		for(i=0;i<leng_b;i++)
			b[i]=s2[leng_b-i-1]-'0';
		for(i=0;i<leng_a;i++)
		{
			if(a[i]>=b[i])
				a[i]-=b[i];
			else
			{
				a[i]=a[i]-b[i]+10;
				a[i+1]--;
			}
		}
		tag=0;
			for ( i =leng_a-1; 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 *jian(char *x, char *y, int m, int n)
{
	char *p1;
	char *p2;
	char *p3;
	p1 = (char *)malloc((m)*sizeof(char));
	p2 = (char *)malloc((m)*sizeof(char));
	p3 = (char *)malloc((m)*sizeof(char));
	strcpy(p1, x);
	strcpy(p2, y);
	p1 = p1 + m - 1;
 	p2 = p2 + n - 1;
	int t = m - 1;
	while(((*p1) >= '0' - 1) && ((*p1) <= '9'))
	{
		if((*p1) < (*p2))
		{
			p3[t] = (*p1) - (*p2) + 10 + '0';
			p1 --;
			*p1 = *p1 - '1' + '0';
			p2 --;
		}
		else if(((*p1) >= (*p2)) && ((*p2) >= '0') && ((*p2) <= '9'))
		{
			p3[t] = (*p1) - (*p2) + '0';
			p1 --;
			p2 --;
		}
		else 
		{
			p3[t] = (*p1);
			p1 --;
			//p2 --;
		}
		t --;
	}
	return(p3);

}

void main()
{
	int s;
	int i, j, k;
	char *a[10], *b[10];
	scanf("%d", &s);
	for(i = 0; i < s; i ++)
	{
		a[i] = (char *)malloc(1000*sizeof(char));
		b[i] = (char *)malloc(1000*sizeof(char));
	}
    for(i = 0; i < s; i ++)
	{
		scanf("%s", a[i]);
		scanf("%s", b[i]);
	}
	for(i = 0; i < s; i ++)
	{
		for(j = 0; j < strlen(a[i]); j ++)
		if(jian(a[i], b[i], strlen(a[i]), strlen(b[i]))[j] != '0')
		{
			k = j;
			break;
		}
	    for(j = k; j < strlen(a[i]); j ++)
		    printf("%c", jian(a[i], b[i], strlen(a[i]), strlen(b[i]))[j]);
		printf("\n");
	}

}
void main()
{
	int n,m,i,j,l1,l2,k,p,o=0,a[200],carry=0,jump;
    char str1[101],str2[101],str3[200];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
        scanf("%s%s",str1,str2);

		l1=strlen(str1);
		l2=strlen(str2);

        str1[101]='\0';
		jump=101-l1;
        for(m=l1-1;m>=0;m--)
		str1[m+jump]=str1[m];
		for(m=0;m<jump;m++)
			str1[m]='0';
		str2[101]='\0';
		jump=101-l2;
		for(m=l2-1;m>=0;m--)
			str2[m+jump]=str2[m];
		for(m=0;m<jump;m++)
			str2[m]='0';

		for(j=100;j>=100-l1;j--)
		{ 
			if(str1[j]>=(carry+str2[j]))
			{
				str3[j]=str1[j]-(str2[j]+carry)+48;
				carry=0;
			}
			else
			{
                str3[j]=str1[j]+10-(str2[j]+carry)+48;
                carry=1;
			}
		}

       for(k=101-l1;k<=100;k++)
	   {
	       printf("%c",str3[k]);

	   }
	   printf("\n");
	}
}
int main()
{
	int j,n,la,lb,i;
	char a[101];
	char b[101];
    
    
	
	
	scanf("%d",&n);
	for(j=0;j<n;j++)
	{
		scanf("%s",a);
		scanf("%s",b);
		la=strlen(a);
		lb=strlen(b);
		for(i=0;i<lb;i++)
		{
			if(a[la-1-i]>=b[lb-1-i])
				a[la-1-i]=a[la-1-i]-b[lb-1-i]+'0';
			else if(a[la-1-i]<b[lb-1-i])
			{
				a[la-1-i]=a[la-1-i]+10-b[lb-1-i]+'0';
				a[la-2-i]=a[la-2-i]-1;
			}
			
		}
	printf("%s\n",a);	
	}
}
int main()
{
    int i,j,n;
    cin>>n;
    char l[1];

    while(n>0)
    {
        cin.getline(l,1);
        char a[100],b[100],c[100];
        cin.getline(a,100);
        cin.getline(b,100);
        int len1=strlen(a),len2=strlen(b);
        for(i=len1-1;i>=len1-len2;i--)
        {
            b[i]=b[i+len2-len1];
        }
        for(i=0;i<len1-len2;i++)
        {
            b[i]=48;
        }
        b[len1]='\0';

        for(i=len1-1;i>=0;i--)
        {
            c[i]=a[i]-b[i]+48;
            if(c[i]<48){c[i]=a[i]-b[i]+58;a[i-1]=a[i-1]-1; }
        }
        i=0; c[len1]='\0';
        while(c[i]==0&&strlen(c)>1)
        {
            for(j=0;j<len1;j++ )
            {
                c[j]=c[j+1];

            }
        }
        cout<<c<<endl;
        n--;
    }
    return 0;
}
int main()
{
    char s1[101],s2[101];
    int num1[101],num2[101];
    int n,i,j,k,q,h,f,len1,len2;
    cin>>n;
   while(cin>>s1>>s2)
    {
         memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
         i=0;
	j=0;
	k=0;
	q=0;
         
    len1=strlen(s1);
    len2=strlen(s2);
    for(i=len1-1;i>=0;i--)
    num1[j++]=s1[i]-'0';//??????????
    
	for(k=len2-1;k>=0;k--)
    num2[q++]=s2[k]-'0';
    for(h=0;h<len1;h++)
      {
         
         num1[h]=num1[h]-num2[h];
        
			if(num1[h]<0)//????????=???
          {
           num1[h]=num1[h]+10;
           num1[h+1]=num1[h+1]-1;
            }
      }
	 f=len1;
      while(num1[f]==0)
		  f--;
       for(;f>=0;f--)
       
		   cout<<num1[f];
       
        cout<<endl;
     }
return 0;
}
void main()
{
	char a[30][100], b[30][100], c[30][100];
	int n, i, j, p[100], q[100], alpha[30][100], beta[30][100], gama[30][100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",a[i]);
		scanf("%s",b[i]);
		for(j=0;a[i][j]!='\0';j++);
		p[i]=j;
		for(j=0;b[i][j]!='\0';j++);
		q[i]=j;
		for(j=0;j<p[i];j++)
			alpha[i][j]=a[i][p[i]-1-j]-48;
		for(j=0;j<q[i];j++)
			beta[i][j]=b[i][q[i]-1-j]-48;
		for(j=q[i];j<p[i];j++)
			beta[i][j]=0;
		for(j=0;j<p[i];j++)
		{
			gama[i][j]=alpha[i][j]-beta[i][j];
			if(gama[i][j]<0)
			{
				gama[i][j]+=10;
				alpha[i][j+1]-=1;
			}
		}
		for(j=0;j<p[i];j++)
			c[i][j]=gama[i][p[i]-1-j]+48;
	}
	for(i=0;i<n;i++)
	{
		for(j=0;c[i][j]=='0';j++);
		for(;j<p[i];j++)
			printf("%c",c[i][j]);
		printf("\n");
	}
}
/**
* @file C8Q4.cpp
* @author ???
* @date 2013-11-17
* @description
* ??????:?????
*/



int main()
{
    char c1[MAX]; //???
    char c2[MAX]; //??
    int n;  //????
    cin >> n;

    for (int i = 0 ; i < n; i++)
    {
        cin.get(); //????????
        cin.getline(c1,MAX-1);
        cin.getline(c2,MAX-1);

        int len1,len2 ;
        len1 = strlen(c1);
        len2 = strlen(c2);

        int p1,p2;  //????????
        p2 = len2-1;
        p1 = len1-1;

        while(p2 >= 0)
        {
            c1[p1] -= c2[p2] - '0';  //????
            if (c1[p1] < '0')  //????
            {
                for (int i = p1 - 1 ; i >= 0 ; i--) //??????
                {
                    c1[i+1] += 10;
                    c1[i] -= 1;
                    if (c1[i] >= '0')  //????????
                        break;
                }
            }
            p2--;p1--;  //?????????
        }

        for(p1 = 0 ; p1 < len1 ; p1++ )  //?????0
        {
            if (c1[p1] != '0')
                break;
        }

        cout << c1 + p1 << endl;
    }
}
void main()
{
	int i=0,j=0,n=0;
	char a[100][205],b[100][205];
	int sa[100][205],sb[100][205];
	int len1,len2,flag=0;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%s %s",a+i,b+i);
	
		for(i=0;i<n;i++)
		{
			len1=strlen(a[i]);
			for(j=0;j<len1;j++)
				sa[i][j]=a[i][len1-1-j]-'0';
		}
		for(i=0;i<n;i++)
		{
			len2=strlen(b[i]);
			for(j=0;j<len2;j++)
				sb[i][j]=b[i][len2-1-j]-'0';
		}

		for(i=0;i<n;i++)
		{
			len2=strlen(b[i]);
			for(j=0;j<len2;j++)
			{
				sa[i][j]-=sb[i][j];
				if(sa[i][j]<0)
				{
					sa[i][j]+=10;
					sa[i][j+1]-=1;
				}
			}
		}


		for(i=0;i<n;i++)
		{
			len1=strlen(a[i]);
			for(j=len1-1;j>=0;j--)
			{
				if(flag==0)
				{
					if(sa[i][j]!=0)
					{
						flag=1;
						printf("%d",sa[i][j]);
					}
				}
				else printf("%d",sa[i][j]);
			}
			printf("\n");flag=0;
		}
	
}
void main()
{
	int n,i,j,len1,len2,t;
	char c[100],d[100];
    int a[100],b[100];
	scanf("%d",&n);
	for(j=1;j<=n;j++)
	{
        for(i=0;i<100;i++)
		{ 
			a[i]=b[i]=0;
			c[i]=d[i]='\0';
		}
     	scanf("%s %s",c,d);
		len1=strlen(c);
		len2=strlen(d);
		for(i=99;i>99-len1;i--)
		{
			switch(c[i+len1-100])
			{
			case'0':a[i]=0;break;
            case'1':a[i]=1;break;
	        case'2':a[i]=2;break;
            case'3':a[i]=3;break;
            case'4':a[i]=4;break;
            case'5':a[i]=5;break;
	        case'6':a[i]=6;break;
            case'7':a[i]=7;break;
            case'8':a[i]=8;break;
            case'9':a[i]=9;
			}
		}

        for(i=99;i>99-len2;i--)
		{
			switch(d[i+len2-100])
			{
			case'0':b[i]=0;break;
            case'1':b[i]=1;break;
	        case'2':b[i]=2;break;
            case'3':b[i]=3;break;
            case'4':b[i]=4;break;
            case'5':b[i]=5;break;
	        case'6':b[i]=6;break;
            case'7':b[i]=7;break;
            case'8':b[i]=8;break;
            case'9':b[i]=9;
			}
		}

		for(i=0;i<100;i++)
		{
			a[i]=a[i]-b[i];
		}

		for(i=99;i>0;i--)
		{
			if(a[i]<0)
			{
				a[i]=10+a[i];
				a[i-1]--;
			}
		}
	     for(i=0;;i++)
			 if(a[i]!=0)break;

		for(t=i;t<100;t++)
			printf("%d",a[t]);

		printf("\n");
	}
}
int main()
{
	int n,i,j,len1,len2;
	char str1[101],str2[101];
	int a[100],b[100];
	cin>>n;
	while(n--)
	{
cin.get();
		len1=0;
		len2=0;
		cin.getline(str1,100);
		cin.getline(str2,100);
		while(str1[len1]!=0) 
			len1++;
		while(str2[len2]!=0)
			len2++;
		memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
		for(i=len1-1;i>=0;i--)
			a[len1-1-i]=str1[i]-'0';
		for(i=len2-1;i>=0;i--)
			b[len2-1-i]=str2[i]-'0';
		for(i=0;i<len1||i<len2;i++)
		{
			if(a[i]>=b[i]) a[i]-=b[i];
			else 
			{
				a[i]=a[i]+10-b[i];
				a[i+1]--;
			}
		}
		int count=99;
		while(a[count]==0) 
			count--;
		for(i=count;i>=0;i--)
		cout<<a[i];
cout<<endl;
	}
return 0;
}
void main ()
{
	int n,i,j,len1,len2,p,q, a[100],b[100],c[100];
	char s1[100],s2[100];
	scanf("%d",&n);
		for (i=0;i<n;i++)
	{
        for(j=0;j<100;j++)
		{
			a[j]=0;
			b[j]=0;
			c[j]=0;
		}
		scanf("%s %s",s1,s2);
		len1=strlen(s1);
		len2=strlen(s2);
		for (p=0;p<len1;p++)
			a[len1-p-1]=s1[p]-'0';
		for (p=0;p<len2;p++)
			b[len2-p-1]=s2[p]-'0';
		for (p=0;p<len1;p++)
		{
			c[p]=a[p]-b[p];
			if (c[p]<0)
			{
				a[p+1]=a[p+1]-1;
				c[p]=c[p]+10;
			}
		}
		while (c[len1]==0&&len1>1)
			len1=len1-1;
		for (q=len1;q>=0;q--)
			printf("%d",c[q]);
		
		printf("\n");
                   }
}
int main()
{
	char c[100][4][100]={'\0'};
	int i,j,k,n;
	scanf("%d\n",&n);
	for(i=0;i<n-1;i++)
	{
		gets(c[i][0]);
		gets(c[i][1]);
		gets(c[i][2]);
	}
	gets(c[n-1][0]);
	gets(c[n-1][1]);

	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(c[i][1]);j++)
		{
			c[i][3][j+strlen(c[i][0])-strlen(c[i][1])]=c[i][1][j];
		}
		for(j=0;j<(strlen(c[i][0])-strlen(c[i][1]));j++)
		{
			c[i][3][j]='0';
		}
		for(j=(strlen(c[i][0])-1);j>=0;j--)
		{
			if(c[i][0][j]>=c[i][3][j])
			{
				c[i][0][j]=c[i][0][j]-c[i][3][j]+48;
			}
			else
			{
				c[i][0][j]=58-(c[i][3][j]-c[i][0][j]);
				for (k=j-1;k>=0;k--)
				{
				    if (c[i][0][k]!='0')
					{
				        c[i][0][k]=c[i][0][k]-1;
						break;
					}
				    else
					{
					    c[i][0][k]='9';
					}
				}
			}
		}
		printf("%s\n",c[i][0]);
		
	}
	return 0;
}
char a[100],b[100];
void reverse(char a[])
{int i,m;
 char t;
 m=strlen(a);
 for(i=0;i<m/2;i++)
   {t=a[i];
    a[i]=a[m-i-1];
    a[m-1-i]=t;
   }
}
void minus(char a[],char b[])
{int i;
for(i=0;i<strlen(b);i++)
 {a[i]=a[i]-b[i];
  if(a[i]<0)
    {a[i]=a[i]+10;
     a[i+1]=a[i+1]-1;
     }
  a[i]=a[i]+48;
  }
}
void main()
{int i,n;char c[2];
 scanf("%d\n",&n);
 for(i=0;i<n-1;i++)
   {
     gets(a);    gets(b);
     gets(c);
     reverse(a);   reverse(b);
     minus(a,b);
     reverse(a);
     puts(a);
    }
     gets(a);       gets(b); 
     reverse(a);   reverse(b);
     minus(a,b);
     reverse(a);
     puts(a);
}
int main()
{
	char a[105],b[105];
	int n,i,j,k,chang1,chang2;
	cin>>n;
	while(n--)
	{
		cin>>a;
		cin>>b;
		chang1=strlen(a);
		chang2=strlen(b);
		i=chang1-1;
		j=chang2-1;
		while(j>=0)
		{
			if(a[i]<b[j])
			{
				if(a[i-1]==0)
				{
					a[i-2]--;
					a[i-1]='9';
					a[i]=a[i]+10;
				}
				else
				{
					a[i-1]--;
					a[i]=a[i]+10;
				}
			}
			a[i]=a[i]-b[j]+'0';
			i--;
			j--;
		}
		k=0;
		if(a[0]=='0')
		{
			for(k=0;k<chang1;k++)
			{
				if(a[k]!='0')
					break;
			}
		}
		if(k==chang1-1)
			cout<<a[k];
		else
			for(i=k;i<chang1;i++)
				cout<<a[i];
		
		cout<<endl;
	}
	return 0;
}
void main()
{
	int n,i,m;
	scanf("%d",&n);
char a[100][101],b[100][101];

	scanf("%s",a[0]);
	scanf("%s",b[0]);
for(i=1;i<n;i++)
{	
	printf("\n");
	scanf("%s",a[i]);
	scanf("%s",b[i]);
}
for(i=0;i<n;i++)
	{
	int c[101],j,l1,l2;
	char d[101];
		l1=strlen(a[i]);
		l2=strlen(b[i]);
		for(m=0;m<(l1-l2);m++)
			d[m]='0';
		for(m=1;m<=l2;m++)
			d[l1-m]=b[i][l2-m];
		for(j=1;j<=l1;j++)
		{
			
			if(a[i][l1-j]>=d[l1-j])
				c[j]=a[i][l1-j]-d[l1-j];
			else
			{
				c[j]=(10+a[i][l1-j])-d[l1-j];
				a[i][l1-j-1]=a[i][l1-j-1]-1;
			}
		}

		for(j=l1;j>=1;j--)
			printf("%d",c[j]);
			printf("\n");
		
	}
}
/*
2736:??????? ?? ?? ?? ????: 1000ms ????: 65536kB 
?? 
?2?????????? 
?? 
?1?????????n????????2???1?????a??2????b(a > b)????????????
??????????100??? 
?? 
n???????????????????? 
???? 
2
9999999999999999999999999999999999999
9999999999999

5409656775097850895687056798068970934546546575676768678435435345
1

???? 
9999999999999999999999990000000000000
5409656775097850895687056798068970934546546575676768678435435344
*/

void reverse(char temp[101])
{
	int i = 0;
	for(i = 0; i < strlen(temp) / 2; i ++)
	{
		char t = '\0';
		t = temp[i];
		temp[i] = temp[strlen(temp) - i - 1];
		temp[strlen(temp) - i - 1] = t;
	}
}
int main ()
{
	int n = 0;
	cin >> n;
	while (n --)
	{
		cin.get();
		char a[101] = {'\0'}, b[101] = {'\0'}, temp[101] = {'\0'}, mark = '+';
		cin.getline(a, 101, '\n');
		cin.getline(b, 101, '\n');
		if((strlen(a) == strlen(b) && strcmp(a, b) < 0) || (strlen(a) < strlen(b)))
		{
			strcpy(temp, a);
			strcpy(a, b);
			strcpy(b, temp);
			mark = '-';
		}
		reverse(a);
		reverse(b);
		int i = 0;
		for(i = 0; i < strlen(b); i ++)
			if(a[i] < b[i])
			{
				a[i] = a[i] + 10 - b[i] + '0';
				a[i + 1] --;
			}
			else if(a[i] >= b[i])
				a[i] = a[i] - b[i] + '0';
		reverse(a);
		cout << a << endl;
	}
	return 0;
}
void main()
{
	int i,n,l,m;
	char a[100],b[100];
	scanf("%d",&n);
	for(;n>0;n--)
	{
		i=1;
		scanf("%s %s",a,b);
		l=strlen(b);
		m=strlen(a);
		while(i<=l)
		{
			if(a[m-i]>=b[l-i])
				a[m-i]=a[m-i]-b[l-i]+48;
			else
			{
				a[m-i]=a[m-i]+58-b[l-i];
				a[m-i-1]=a[m-i-1]-1;
			}
			i++;
		}
		for(i=m-l-1;m>=0;m--)
		{
			if(a[i]<'0')
			{
				a[i]+=10;
				a[i-1]=a[i-1]-1;
			}
			else break;
		}
		printf("%s\n",a);
	}
}
//****************************************************** 
//* ? ? ?   ?? ? ? ? ?                        *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 11 ? 17 ?                   * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{
	char aa[100], bb[100]; //?????????
	int a[100], b[100], c[100];
	int n, la, lb;
	cin >> n;
	for (int i = 0; i < n; i ++)
	{
		cin >> aa >> bb;
		la = strlen(aa);
		lb = strlen(bb);
		for (int j = 0; j < la; j ++) //???????????
		{
			a[j] = aa[j] - 48;
			b[j] = bb[j] - 48;
		}
		for (int j = 1; j <= lb; j ++) //????????????
			c[la - j] = a[la - j] - b[lb - j];
		for (int j = 0; j < la - lb; j ++) //b?????????0??????
			c[j] = a[j];
		for (int j = la - 1; j > 0; j --) //??????0??????10??????1(????
			if (c[j] < 0)
			{
				c[j] += 10;
				c[j - 1] -= 1;
			}
		int k;
		for (int j = 0; j < la; j ++) //???????0??
			if (c[j] != 0)
			{
				k = j;
				break;
			}
		for (int j = k; j < la; j ++) //????
			cout << c[j];
		cout << endl;
	}
	return 0;
}
int main()
{
    int n, i, j, cnt = 0;
    cin >> n;
    int a[100], b[100], c[100];
    char num1[101], num2[101];
    while(cnt < n)
    {
        cin >> num1;
        cin >> num2;
        int len1 = strlen(num1);
        int len2 = strlen(num2);
        memset(a, 0, sizeof(a));
        memset(b, 0, sizeof(b));
        memset(c, 0, sizeof(c));
        j = 0;
        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 < len2; i++)
        {
            if(a[i] < b[i])
            {
                if(a[i] == -1)
                    a[i] = 9;
                else
                    a[i] += 10;
                a[i + 1]--;
            }
            c[i] = a[i] - b[i];
        }
        if(len1 > len2)
        {
            for(i = len2; i < len1; i++)
                c[i] = a[i];
        }
        for(i = len1 - 1; i >= 0; i--)
        {
            if(c[i] != 0)
                break;
        }
        for( ; i >= 0; i--)
            cout << c[i];
        cout << endl;
        cnt++;
    }
    return 0;
}
int lena,lenb,lenc;
void minus(char a[],char b[],char c[])
{	int carry=0,i;
	for(i=lena-1;i>=0;i--)
	{if(a[i]-b[i]-carry<0)
		{c[i]=a[i]+10-b[i]+'0'-carry;
		carry=1;
		}
	else if(a[i]-b[i]-carry>=0)
		{c[i]=a[i]-b[i]+'0'-carry;
		carry=0;
		}
	}
	c[lena]='\0';
}
void operate(char b[])
{	int jump=lena-lenb;
	int i;
	b[lena]='\0';
	for(i=lenb;i>=0;--i)
		b[i+jump]=b[i];
	for(i=0;i<jump;i++)
		b[i]='0';
}
void main()
{	char a[ARRAY][N],b[ARRAY][N],c[N];
	int i,j,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{scanf("%s",a[i]);
	scanf("%s",b[i]);
	printf("\n");
	}
	for(i=0;i<n;i++)
	{lena=strlen(a[i]);lenb=strlen(b[i]);
	operate(b[i]);
	minus(a[i],b[i],c);
	for(j=0;j<lena;j++)
		if(c[j]!='0') break;
	for(;j<lena;j++)
		printf("%c",c[j]);
	printf("\n");
	}
}