semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
main()
{
int n;
int i;
int j;
int l1;
int l2;
scanf("%d",&n);
char **pp=(char **)malloc((2*n)*sizeof(char *));
for(i=0;i<2*n;i++)
pp[i]=(char *)malloc(100*sizeof(char));
for(i=0;i<2*n;i++)
scanf("%s",pp[i]);
for(i=0;i<2*n;i=i+2)
{
	l1=strlen(pp[i]);
	l2=strlen(pp[i+1]);
	for(j=0;j<l2;j++)
	{
		pp[i+1][l1-j-1]=pp[i+1][l2-j-1];
	}
	for(j=0;j<l1-l2;j++)
	{
		pp[i+1][j]='0';
	}
	for(j=l1-1;j>l1-l2-1;j=j-1)
	{
		if(pp[i][j]-pp[i+1][j]<0)
		{
			pp[i][j-1]=pp[i][j-1]-1;
			pp[i][j]='0'+pp[i][j]-pp[i+1][j]+10;
		}
		else
		{
			pp[i][j]='0'+pp[i][j]-pp[i+1][j];
		}
	}
	printf("%s\n",pp[i]);

}
for(i=0;i<2*n;i++)
	free(pp[i]);
free(pp);
}
int main()
{
    int n,u,i ,Len1=0,Len2=0,max=0;
    const int MAX_LEN = 100;
    int num1[MAX_LEN+1]={0};int num2[MAX_LEN+1]={0};
    char str1[MAX_LEN + 1];char str2[MAX_LEN + 1];
    cin >> n;
    cin.get();
    for (u=0;u<n;u++)
    {
        cin.getline(str1, MAX_LEN + 1);
        cin.getline(str2, MAX_LEN + 1);
        Len1 = strlen(str1);
        Len2 = strlen(str2);
        for (i = Len1 - 1; i >= 0; i--)
        num1[Len1-1-i] =  str1[i]-'0';

        for (i = Len2 - 1;  i >= 0; i--)
        num2[Len2-1-i] =  str2[i]-'0';
        if (Len1>Len2)
        {
            max=Len1;
        }
        else
        max=Len2;


        for (i = 0; i <max; i++)
        {
             num1[i]=num1[i]- num2[i];
             if(num1[i]<0)
             {
                 num1[i]=num1[i]+10;
                 num1[i+1]=num1[i+1]-1;
             }
        }
        i = MAX_LEN;
        while (num1[i]==0)
        i--;

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

        cout << endl;
        for (i=0;i<MAX_LEN;i++)
        {
            num1[i]=0;
            num2[i]=0;
        }
        Len1=0;
        Len2=0;
        max=0;
        if (i!=n-1)
        cin.get();

    }
    return 0;
}
int main()
{
	int n;cin>>n;
	for(int N=0;N<n;N++)
	{
		char a[110],b[110];
		cin>>a>>b;
		int A[110]={0},B[110]={0},result[110]={0};
		for(int i=strlen(a)-1;i>=0;i--) 
		{
			A[strlen(a)-i-1]=a[i]-'0';
		}
		for(int i=strlen(b)-1;i>=0;i--) 
		{
			B[strlen(b)-i-1]=b[i]-'0';
		}



		for(int i=0;i<110;i++)
		{
			result[i]+=(A[i]-B[i]);
			if(result[i]<0) {result[i]+=10;result[i+1]--;}
		}
		int t;
		for(t=109;t>0;t--) if(result[t]) break;
		for(;t>0;t--) cout<<result[t];
		cout<<result[0]<<endl;
	
	
	}

	cin.get();cin.get();cin.get();cin.get();cin.get();

}
/*
 * temperary.cpp
 *
 *  Created on: 2011-12-25
 *      Author: ???
 */

int main() {
	int n;
	cin>>n;
	while(n>0){
		n--;
		char a[100],b[100];
		cin>>a>>b;
		int l1=strlen(a),l2=strlen(b),i,c[100];
		for(i=0;i<l2;i++){
			if(a[l1-1-i]<b[l2-1-i]){
				a[l1-2-i]--;
				a[l1-1-i]+=10;
			}
			c[i]=a[l1-1-i]-b[l2-1-i];
		}
		for(i=l2;i<l1;i++){
			if(a[l1-1-i]<'0'){
				a[l1-2-i]--;
				a[l1-1-i]+=10;
			}
			c[i]=a[l1-1-i]-48;
		}
		while(c[i-1]==0)i--;
		while(i>0){
			i--;cout<<c[i];
		}
                   cout<<endl;
	}
	return 0;
}
void main()
{
	int j,b,a,i,x=0,y,z=1,m,n,s,t;
	scanf("%d",&a);
	char j_shu[65][101],b_shu[65][101],shu[65][101];
	for(i=0;i<a;i++)
	{
		j=0;
		while(1)
		{
			if((y=getchar())!='\n')
				j_shu[i][j++]=y;
			else
				if(j>0)
				{
					j_shu[i][j]='\0';
					break;
				}
		}
		b=0;
		while(1)
		{
			if((y=getchar())!='\n')
				b_shu[i][b++]=y;
			else
				if(b>0)
				{
					b_shu[i][b]='\0';
					break;
				}
		}
		m=strlen(j_shu[i]);
		n=strlen(b_shu[i]);
		b_shu[i][m]='\0';
		for(s=m-1,t=n-1;t>=0;s--,t--)
		{
			if(j_shu[i][s]<b_shu[i][t])
			{
				j_shu[i][s]=j_shu[i][s]+10;
				j_shu[i][s-1]=j_shu[i][s-1]-1;
			}
			shu[i][s]=j_shu[i][s]-b_shu[i][t];
		}
		for(;s>=0;s--)
		{
			if(j_shu[i][s]<0)
			{
				j_shu[i][s]=j_shu[i][s]+10;
				j_shu[i][s-1]=j_shu[i][s-1]-1;
			}
			shu[i][s]=j_shu[i][s]-48;
			//printf("%d",shu[i][s]);
		}
	}
	for(i=0;i<a;i++)
	{
		m=strlen(j_shu[i]);
		for(s=0,t=0;s<m;s++)
			if(shu[i][s]==0&&t==0)
				continue;
			else
				if(shu[i][s]==0)
					printf("0");
				else
				{
					t++;
					printf("%d",shu[i][s]);
				}
		if(t==0)
			printf("0");
		printf("\n",m);
	}
}
void main()
{
	int flag2,flag,j,k,lengtha,lengthb,n,i;
	char temp,a[100],b[100];
	flag=0;
	flag2=0;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		if (flag2) temp=getchar();
		else flag2=1;
		scanf("%s",a);
		scanf("%s",b);
		lengtha=strlen(a);
		lengthb=strlen(b);
		for (j=1;j<=lengthb;j++)
		{
			a[lengtha-j]=a[lengtha-j]-b[lengthb-j]+48;
			k=lengtha-j;
			while (a[k]<48)
			{
				a[k]=a[k]+10;
				a[k-1]--;
				k--;
			}
		}		
		if (flag) printf("\n");
		else flag=1;
		printf("%s",a);

	}
}
int beijianshu[200]={0},jianshu[200]={0},cha[200]={0};
int len1,len2;
int flag;
char a[200],b[200];
void reverse(char a[],char b[])
{
	int i;
	for(i=0;i<len1;i++) beijianshu[i]=a[len1-i-1]-'0';
	for(i=0;i<len2;i++) jianshu[i]=b[len2-i-1]-'0';
}
int panduan()
{
	if (len1>len2) return 1;
	else if (len1==len2)
	{
		for(int i=0;i<len1;i++) 
		{
			if(a[i]>b[i]) return 1;
			else if(a[i]<b[i]) return -1;
		}
		return 0;
	}
	else return -1;
}
void calculate()
{
	int i;
	if(flag!=0)
	{
		for(i=0;i<len1||i<len2;i++) cha[i]=beijianshu[i]-jianshu[i];
		if(flag==1)
		{
			for(i=0;i<len1;i++) 
			{
				if(cha[i]<0) 
				{
					cha[i+1]--;
					cha[i]+=10;
				}
			}
		}
		else
		{
			for(i=0;i<=len2;i++) 
			{
				if(cha[i]>0)
				{
					cha[i]-=10;
					cha[i+1]++;
				}
			}
		}
	}
}
void print()
{
	int i;
	if(flag==0) cout<<0<<endl;
	else 
	{
		for(i=199;i>=0;i--) if(cha[i]!=0) break;
		if(flag==1) for(;i>=0;i--) cout<<cha[i];
		else 
		{
			cout<<'-';
			for(;i>=0;i--) cout<<0-cha[i];
		}
		cout<<endl;
	}
}
int main()
{
	int n;
	cin>>n;
	cin.get();
	for(int i=0;i<n;i++)
	{
		memset(a,'\0',sizeof(a));
		memset(b,'\0',sizeof(b));
		memset(beijianshu,0,sizeof(beijianshu));
		memset(jianshu,0,sizeof(jianshu));
		memset(cha,0,sizeof(cha));
		cin.getline(a,200);
		cin.getline(b,200);
		cin.get();
		len1=strlen(a);
		len2=strlen(b);
		reverse(a,b);
		flag=panduan();
		calculate();
		print();
	}
	return 0;
}
int main()
{
	int n;
	char str1[101],str2[101];
	int a1[100],a2[100];
	cin>>n;
	int l1,l2;
	for(int i=0;i<n;i++)
	{
		cin>>str1>>str2;
		memset(a1,0,sizeof(a1));
		memset(a2,0,sizeof(a2));
		l1=strlen(str1);
		l2=strlen(str2);
		int k1=0,k2=0;
		for(int j=l1-1;j>=0;j--)
			a1[k1++]=str1[j]-'0';
		for(int j=l2-1;j>=0;j--)
			a2[k2++]=str2[j]-'0';
		for(int j=0;j<100;j++)
		{
			a1[j]=a1[j]-a2[j];
			if(a1[j]<0)
			{
				a1[j]+=10;
				a1[j+1]--;
			}
		}
		int k=99;
		while(a1[k]==0) k--;
		for(;k>=0;k--)
			cout<<a1[k];
		cout<<endl;
	}
	return 0;
}
int main(){
	int n,t;
	cin>>n;
	for(t=1;t<=n;t++){
	char a[101],b[101],c[101];
	cin>>a;
	cin>>b;
	int n1,n2,n3,i,j,k=0;
	n1=strlen(a),n2=strlen(b),n3=strlen(a);
	for(i=n1-1,j=n2-1;i>=0;i--,j--)
	{
		if(j>=0)
		{
			if(a[i]-k>=b[j])
			{
				c[i]=a[i]-b[j]-k+48;
				k=0;
			}
			else
			{
				c[i]=a[i]+10-b[j]-k+48;
				k=1;
			}
		}
		else
		{
			if(a[i]-48>=k)
			{
				c[i]=a[i]-k;
				k=0;
			}
			else
			{
				c[i]=10+a[i]-k;
				k=1;
			}
		}
	}
	if(c[0]!='0')
		cout<<c[0];
	for(i=1;i<n1-1;i++)
		cout<<c[i];
	cout<<c[n1-1]<<endl;}
	return 0;
}
/*??
 ?2??????????
 ????
 ?1?????????n????????2???1?????a??2????b(a > b)??????????????????????100?
 ????
 n????????????????????
 ????
 2
 
 9999999999999999999999999999999999999
 
 9999999999999
 
 
 
 5409656775097850895687056798068970934546546575676768678435435345
 
 1
 ????
 9999999999999999999999990000000000000
 
 5409656775097850895687056798068970934546546575676768678435435344
 */
char imim[101],isub[101],istore[101];
int carry=0;
char *p=NULL,*q=NULL;
void subtraction()
{
    if(q==isub)
    {
        *p=(*p-*q-carry+'0');
    }
    else
    {
        if(*p>=(*q+carry))
        {
            
            *p=(*p-*q-carry+'0');
            carry=0;
        }
        else
        {
            *p=(*p+10-*q-carry+'0');
            carry=1;
        }
        p--;q--;
        subtraction();
    }
}
int main()
{
    int n=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        memset(imim,'0',sizeof(imim));
        memset(isub,'0',sizeof(isub));
        memset(istore,'0',sizeof(istore));
        carry=0;
        cin>>imim>>istore;
        int gap=0;
        gap=strlen(imim)-strlen(istore);
        for(int i=0;i<=strlen(istore);i++)
        {
            isub[i+gap]=istore[i];
        }
        p=imim+strlen(imim)-1;
        q=isub+strlen(isub)-1;
        subtraction();
        cout<<imim<<endl;
    }
    return 0;
}
//***************************
//*????????        **
//*????? 1300012921   **
//*???2013.11.18        **
//*************************** 
int main()

{
	char a[101], b[101];
	int i, j, k, n, len1, len2;
	int c[103], d[103], e[103];
	cin >> n;
	cin.get();
	
	for(k = 1; k <= n; k++)
	{
		memset(c,0,sizeof(c));
		memset(d,0,sizeof(d));
		memset(e,0,sizeof(e));		
		cin.getline(a,101);
		cin.getline(b,101);
		len1 = strlen(a);
		len2 = strlen(b);
		
		for(i = len1 - 1; i >= 0; i--)
			c[len1-i] = a[i] - '0';
		
		for(i = len2 - 1; i >= 0; i--)
			d[len2-i] = b[i] - '0';
		
		for(i = 1; i <= 101; i++)
		{
			if(c[i] >= d[i])
				e[i] = c[i] - d[i];
			else
			{
				e[i] = c[i] - d[i] + 10;
				c[i+1] = c[i+1] - 1;
			}
		}
		
		for(j = 101; j >= 1; j--)//???? 
		{
			if(e[j] != 0)
			{
				for(i = j; i >= 1; i--)
					cout << e[i];
				break;
			}
		}
		cout << endl;
		cin.get();
	}
	return 0;
}
void main()
{
	int n,i,j;
	struct num
	{
		char a[101];
		int na;
		char b[101];
		int nb;
		char c[101];
	}num[999];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",num[i].a);
		scanf("%s",num[i].b);
		getchar();
	}
	for(i=0;i<n;i++)
	{
		for(j=0;num[i].a[j]!='\0';j++)
			num[i].na=j+1;
		for(j=0;num[i].b[j]!='\0';j++)
			num[i].nb=j+1;
		for(j=1;j<=num[i].nb;j++)
		{
			num[i].c[num[i].na-j]=num[i].a[num[i].na-j]-num[i].b[num[i].nb-j]+'0';
			if(num[i].c[num[i].na-j]<'0')
			{
				num[i].a[num[i].na-j-1]--;
				num[i].c[num[i].na-j]+=10;
			}
		}
		for(j=0;j<num[i].na-num[i].nb;j++)
			num[i].c[j]=num[i].a[j];
		num[i].c[num[i].na]='\0';
		printf("%s\n",num[i].c);
		
	}
}
int a[10000]={0},b[10000]={0},c[10000],d[10000];

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

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

void jian()
{
     for(i=0;i<ml+3;i++)
     a[i]=b[i]=c[i]=0;
     for(i=0;i<l1;i++)
     {
         a[i]=s1[l1-i-1]-'0';
     }
     for(i=0;i<l2;i++)
     {
         b[i]=s2[l2-i-1]-'0';
     }
     for(i=0;i<ml;i++)
     {
         c[i]=a[i]-b[i];
         if(c[i]<0)
         {
            c[i]+=10;
            a[i+1]-=1;
         }
     }
     while(c[ml]==0 && ml>0)
     ml--;
     for(i=ml;i>=0;i--)
     printf("%d",c[i]);
     printf("\n");
}

int main()
{
    scanf("%d",&n);
    while(n--)
    {
         scanf("%s",s1);
         scanf("%s",s2);
         l1=strlen(s1);
         l2=strlen(s2);
         ml=l1;
         jian();
    }
    return 0;
}
void main ()
{
	int i=0,j=0,k,t,r=0,h;
    int x[100],y[100],z[100],s[100]={0};
	char a[100][100],b[100][100];
    scanf ("%d",&j);
    for (i=0;i<j;i++)
   {
   scanf ("%s%s",a[i],b[i]);
   getchar();
   x[i]=strlen(a[i]);
   y[i]=strlen(b[i]);
	}
	for (i=0;i<j;i++)
	{
        for (k=0;k<y[i];k++)
		{
			if (a[i][x[i]-k-1]>=b[i][y[i]-k-1])
			{
				a[i][x[i]-k-1]=a[i][x[i]-k-1]-b[i][y[i]-k-1]+'0';
			}
			else 
			{
                a[i][x[i]-k-1]=a[i][x[i]-k-1]-b[i][y[i]-k-1]+10+'0';
				a[i][x[i]-k-2]=a[i][x[i]-k-2]-1;
			}
		}
	}
     for (i=0;i<j;i++)
	 {
         printf("%s\n",a[i]);
	 }

   
   
	
	
     
      
}
int main()
{
    char s1[256], s2[256];
    int c[256], a, b, i, l1, l2, n, j, l;

    scanf("%d", &n);
    for (j = 0; j < n; j++) {
        l = 0;
        memset(c, 0, sizeof(c));
        scanf("%s%s", s1, s2);

        // ??????????
        l1 = (int)strlen(s1);
        l2 = (int)strlen(s2);

        while (l1 > 0 || l2 > 0) {
            // ?????????
            a = (l1 > 0) ? s1[--l1] - '0' : 0;
            b = (l2 > 0) ? s2[--l2] - '0' : 0;
            // ????????????????
            // ????????????????????
            c[l] += a - b;
            c[l + 1] = (c[l] - 9) / 10;
            c[l] = (c[l] + 10) % 10;
            l++;
        }

        // ??????????????????
        while (c[l] == 0 && l > 0)
            l--;
        for (i = l; i >= 0; i--)
            printf("%d", c[i]);
        printf("\n");
       }
return 0;
}
void minus(char a[],char b[],char result[]);
void main()
{
	int n,i;
	char a[max][1000]={0},b[max][1000]={0};
    char result[max][1000]={0};
	scanf("%d\n",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%s\n%s\n\n",a[i],b[i]);
		minus(a[i],b[i],result[i]);       
        printf("%s\n",result[i]);
	}
}

void minus(char a[],char b[],char result[])
{ 
	int la,lb,lresult;
    int flag=0;
    int t=0;
    int s,c=0;
    int i;
    char h[1000]={0};
    char temp1;
    la=strlen(a)-1;
    lb=strlen(b)-1;
    while(la >= 0)
	{
        if(lb < 0)
		{
			s=a[la--]-48;
		}
        else 
		{
			s=a[la--]-b[lb--];
		}
        result[t++]=s-c+48;
        if(result[t-1] < 48) 
		{
			result[t-1]+=10;
			c=1;
		}
        else c=0;
	}
	while(result[t] == 0) t--;
    while(result[t] == '0')
	{
		result[t]=0;t--;
	} 
	lresult=t;
	for(i=0;i <= lresult/2;i++)
	{
        temp1=result[i];
        result[i]=result[lresult-i];
        result[lresult-i]=temp1;
    }
}
void main()
{
	int n,i,j;
	int len1,len2;
	char num[2][100],emp[1];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%s%s",num[0],num[1]);
		len1=strlen(num[0]);
		len2=strlen(num[1]);
		for(j=0;j<len2;j++)
		{
			if(num[0][len1-1-j]>=num[1][len2-1-j])
				num[0][len1-1-j]=num[0][len1-1-j]-num[1][len2-1-j]+'0';
			else
			{
				num[0][len1-1-j]=num[0][len1-1-j]+10-num[1][len2-1-j]+'0';
				num[0][len1-2-j]=num[0][len1-2-j]-1;
			}
		}
		puts(num[0]);
		gets(emp);
	}
}
struct number
{
	char a[100];
	int lena;
	char b[100];
	int lenb;
}num[1000];

void main()
{
	int n,i,j,ll;

	scanf("%d",&n);

	for(i=0;i<n;i++)
	{
		   scanf("%s",num[i].a);
	       num[i].lena=strlen(num[i].a);
		   scanf("%s",num[i].b);
	       num[i].lenb=strlen(num[i].b);
	}
	for(i=0;i<n;i++)
	{
		ll=num[i].lena-num[i].lenb;
		for(j=num[i].lenb-1;j>=0;j--)
		{	
			if(num[i].a[j+ll]-num[i].b[j]>=0)
				num[i].a[j+ll]=num[i].a[j+ll]-num[i].b[j]+48;
			else
			{
				num[i].a[j+ll]=num[i].a[j+ll]-num[i].b[j]+48+10;
				num[i].a[j+ll-1]--;
			}
		}
		printf("%s\n",num[i].a);
	}

}
void change(char ch[],int a[])
{
	int i;
	int nc;
	nc=strlen(ch);
	for(i=0;i<nc;i++)
	{
		a[i]=ch[i]-48;
	}
}

void minus(int a[],int b[],int na,int nb)
{
	int i;
	for(i=1;i<=nb;i++)
	{
		if(a[na-i]<b[nb-i])
		{
			a[na-i-1]--;
			a[na-i]=a[na-i]-b[nb-i]+10;
		}
		else
		{
			a[na-i]-=b[nb-i];
		}
	}
}

void print(int a[],int na)
{
	int i,j=0;
	for(j=0;a[j]==0;j++)
		i++;
	for(i=j;i<na;i++)
		printf("%d",a[i]);
}
int main()
{
	int a[100],b[100];
	char c[100];
	int n,i,j,na,nb;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%s",c);
		na=strlen(c);
		change(c,a);
		for(j=0;j<100;j++)
			c[j]='\0';
		scanf("%s",c);
		nb=strlen(c);
		change(c,b);
		minus(a,b,na,nb);
		print(a,na);
		printf("\n");
	}
	return 0;
}
void f(char a[],char b[])
{
	int i,m,n,j;
	char c[100];
    for(i=0;i<100;i++)
		c[i]=0;
	m=strlen(a);
	for(j=m-1;j>=0;j--)
	{
		a[j+100-m]=a[j];
		a[j]='0';
	}
	if(a[m]==0) a[m]='0';
	n=strlen(b);
	for(j=n-1;j>=0;j--)
	{
		b[j+100-n]=b[j];
		b[j]='0';
	}
    if(b[n]==0) b[n]='0';
	for(i=99;i>=0;i--)
	{
		if(a[i]>=b[i])
			c[i]=a[i]-b[i];
		else
		{
			c[i]=a[i]+10-b[i];
			a[i-1]=a[i-1]-1;
		}
	}
	for(j=0;j<100;j++)
	{
		if(c[j]!=0)
			break;
	}
	for(j;j<=99;j++)
		printf("%d",c[j]);
	printf("\n");
}
void main()
{
	char a[100],b[100];
	int i,num,j;
	scanf("%d",&num);
	getchar();
	for(i=0;i<num;i++)
	{
		for(j=0;j<100;j++){
			a[j]='0';
			b[j]='0';
		}
		gets(a);
	
		gets(b);
		f (a,b);
                  getchar();
	
	}
}
void minus(char a[],char b[]);
void main()
{
	int n,i;
	char a[max][max],b[max][max];
	scanf("%d\n",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%s\n%s\n\n",a[i],b[i]);
		minus(a[i],b[i]);       
        printf("%s\n",a[i]);
	}
}

void minus(char a[],char b[])
{ 
	int la,lb,i,t,j,s,c,k=0;
    la=strlen(a)-1;
    lb=strlen(b)-1;
	for(i=la-lb;i<=la;i++)
	{
		s=a[i];
		c=b[k];
		a[i]=s-c+48;
		t=i;
		while(a[i]<'0')
		{
			a[i]+=10;
			a[--i]--;
		}
		i=t;
		k++;
	}
	i=0;
	while(a[i]=='0')
	{
		for(j=0;j<=strlen(a);)
		{
			a[j]=a[++j];
		}
		i++;
	}
}
void main()
{
	int n,i,j,j1,l,l1;
	char str[100][100],str1[100][100];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%s%s",str[i],str1[i]);
     	getchar();
	}
	for(i=1;i<=n;i++)
	{
		l=strlen(str[i]);
		l1=strlen(str1[i]);
		j=0;
		while(j<l1)
		{
			str[i][l-1-j]='0'+(int)str[i][l-1-j]-(int)str1[i][l1-1-j];
			j1=j;
			while(str[i][l-1-j1]<'0')
			{
				str[i][l-1-j1]=10+str[i][l-1-j1];
				j1++;
				str[i][l-1-j1]='0'+(int)str[i][l-1-j1]-(int)'1';
			}
			j++;
		}
		j1=0;
		while(str[i][j1]=='0') j1++;
		for(j=j1;j<l;j++)putchar(str[i][j]);
		printf("\n");
	}
}
void main()
{
	int a,j,i;
	scanf("%d",&a);
	char **pp,**qq;
	int m,n;
	pp = (char **)malloc(a*sizeof(char*));
	qq = (char **)malloc(a*sizeof(char*));
	for(i=0;i<a;i++)
	{
		pp[i]=(char*)malloc(101*sizeof(char));
		qq[i]=(char*)malloc(101*sizeof(char));
		scanf("%s",pp[i]);
		scanf("%s",qq[i]);
	}
	for(i=0;i<a;i++)
	{
		m = strlen(pp[i]);
		n = strlen(qq[i]);
		for(j=m-1;j>=m-n;j--)
		{
			if(pp[i][j]<qq[i][n-m+j])
			{
				pp[i][j] = 10 + pp[i][j] - qq[i][n-m+j] + '0';
				pp[i][j-1]--;
			}
			else if(pp[i][j]>=qq[i][n-m+j])
				pp[i][j] = pp[i][j] - qq[i][n-m+j] + '0';
		}
		for(j=m-1;j>=0;j--)
			if(pp[i][j]<'0')
			{
				pp[i][j] += 10;
				pp[i][j-1] -= 1;
			}
		printf("%s\n",pp[i]);
	}
}
void main()
{
    int n;
	int a[100]={0},b[100]={0},r[100][100]={0};   
    int i,j,t=0,l1,l2; 
	char c[100];

	
	scanf("%d",&n);
	
	while(1)
    
{
	if(getchar()=='\n') t++;


	//a
	for(i=0;i<100;i++)
		c[i]='\0';
		
	for(i=0;(c[i]=getchar())!='\n';i++);

	l1=strlen(c)-1;

	for(i=0;i<100;i++)
		a[i]=0;

	for(i=0;i<l1;i++)
		a[l1-1-i]=c[i]-48;

	

	//b
    for(i=0;i<100;i++)
		c[i]='\0';
		
	for(i=0;(c[i]=getchar())!='\n';i++);

	l2=strlen(c)-1;

	for(i=0;i<100;i++)
		b[i]=0;
	
	for(i=0;i<l2;i++)
		b[l2-1-i]=c[i]-48;
	
  
	
		

  for(i=0;i<l1;i++)   
      {   
          if(a[i]>=b[i])   
              a[i]=a[i]-b[i];//??????????????a[]   
          else   if   (a[i]<b[i])//??????   
              {   
                a[i]=a[i]+10-b[i];   
                  
                for(j=i+1;j<l1;j++)   
                    {   
                        if   (a[j])   //????0??1??????   
                            {   
                              a[j]--;//??   
                              break;//????   
                            }   
                          else   if   (!a[j])   //????0??9??????????   
                            a[j]=9;   
                    }   
                }   
        
     }  
  


	
         
  for(i=0;i<l1;i++)
  r[t][i]=a[i];
  
  if(t==n) break;
 

  
}
    
  for(t=1;t<=n;t++)
  {
	  for(j=l1-1;j>=0;j--)
		if(r[t][j]!=0) break;

	
      for(i=j;i>=0;i--)
		  printf("%d",r[t][i]);
	printf("\n");
  }






}
int main()
{
  int n,l1,l2,s3[101],i,j;
  char s1[101],s2[101],s6[2];
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {gets(s6);
   gets(s1);
   gets(s2);
  l1=strlen(s1);l2=strlen(s2);
  for(j=1;j<=l2;j++)
  { if (s1[l1-j]>=s2[l2-j]) s3[l1-j]=s1[l1-j]-s2[l2-j];
    if (s1[l1-j]<s2[l2-j])  {s3[l1-j]=10+s1[l1-j]-s2[l2-j];s1[l1-j-1]=s1[l1-j-1]-1;}
  }
  for(j=0;j<l1-l2;j++)
	  s3[j]=s1[j]-'0';
   for(j=0;j<l1;j++)
	  printf("%d",s3[j]);
      printf("\n");
  }
}
int main()
{
	char a[102] , b[102] ;
	int n, i=0, j=0 ,lena, lenb;
	cin>>n;
	for(i=0; i<n; i++)
	{
		int p[102]={0};
		int q[102]={0};
		
		cin>>a>>b;
		lena=strlen(a);
		lenb=strlen(b);
		for(j=0; j<lena; j++)
		{
			 p[j]=a[lena-j-1]-'0';
		}
		for(j=0; j<lenb; j++)
		{
			 q[j]=b[lenb-j-1]-'0';
		}
		for(j=0; j<=lena; j++)
		{
			 if(p[j]<q[j])
		{
			p[j+1]--;
			p[j]=p[j]-q[j]+10;
		}
			else
				p[j]-=q[j];
		}
		int temp=1;
		for(j=lena; j>=0; j--)
		{
			
			if(p[j]==0 && temp==1)
				continue;
			if(p[j]!=0)
			{
				cout<<p[j];
				temp=0;
			}
			if(p[j]==0)
				cout<<p[j];
		}
		cout<<endl;
	}
	return 0;
}
int main()
{
	int a1[100], a2[100];
	char b1[101],b2[101];
	int n;
	cin>>n;
	for(int k=0;k<n;k++)
	{
		cin>>b1>>b2;
		int l1=strlen(b1),l2=strlen(b2);
		memset(a1,0,sizeof(a1));
		memset(a2,0,sizeof(a2));
		int j=0;
		for(int i=l1-1;i>=0;i--)
		{
			a1[j++]=b1[i]-'0';
		}
		j=0;
		for(int i=l2-1;i>=0;i--)
		{
			a2[j++]=b2[i]-'0';
		}
		for(int i=0;i<100;i++)
		{
			if(a1[i]<a2[i])
			{
				a1[i]=10+a1[i]-a2[i];
				a1[i+1]--;
			}
			else
			{
				a1[i]=a1[i]-a2[i];
			}}
		int i=99;
		while(a1[i]==0) i--;
		for(;i>=0;i--)
		{cout<<a1[i];}
			cout<<endl;
		}
	return 0;
}
int main()
{
	char numa[201],  numb[201];
	int a[201], b[201], result[201];
	int n, i, j, k, la, lb;
	cin >> n;
	for (; n > 0; n--)
	{
		k = 0;
		cin.ignore();
		cin.getline(numa, 201);
		cin.getline(numb, 201);	
		la = strlen(numa);
		lb = strlen(numb);
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		memset(result, 0, sizeof(result));
		for(i = 0; i < la; i ++)
		{
			a[i] = numa[i] - '0';
		}
		for(j = 0; j < lb; j++)
		{
			b[j] = numb[j] - '0';
		}
		for(i = la - 1, j = lb - 1; i >= 0; i--, j--)
		{
			if(b[j] > a[i])
			{
				b[j - 1]++;
				result[i] = 10 + a[i] - b[j];
			}
			else
				result[i] = a[i] - b[j];
		}
		while (result[k] == 0)
			k++;
		for(i = k; i < la; i++)
			cout << result[i];
		cout << endl;
	}
	return 0;
}
int main()
{
	int a[200],b[200],len1,len2,n,k;
	char str1[200];char str2[200];
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		cin.get();
		cin.getline(str1,200);
		cin.getline(str2,200);
		len1=strlen(str1);
		len2=strlen(str2);
		k=0;
		for(int j=len1-1;j>=0;j--)
		{
			a[k]=str1[j]-'0';
			k++;
		}
		k=0;
		for(int j=len2-1;j>=0;j--)
		{
			b[k]=str2[j]-'0';
			k++;
		}
		for(int j=0;j<len1;j++)
		{
			a[j]=a[j]-b[j];
			if(a[j]<0)
			{
				a[j]=a[j]+10;
				a[j+1]--;
			}
		}
		for(int j=len1-1;j>=0;j--)
		{
			cout<<a[j];
		}
		cout<<endl;
	}
	return 0;
}
int main(int argc, char* argv[])
{
	char a[200],b[200],c[200];
	int n,i,j,al,bl;
	scanf("%d\n",&n);
	for (i=0;i<n;i++)
	{
		if(i>0) scanf("\n");
		gets(a);
		gets(b);
		al=strlen(a);
		bl=strlen(b);
		for (j=0;j<=bl-1;j++) b[al-1-j]=b[bl-1-j];
		for (j=0;j<al-bl;j++) b[j]=48;
		b[al]=0;
		for (j=al-1;j>=0;j--)
		{
			if(a[j]>=b[j])	c[j]=a[j]-b[j]+48;
			else 
			{
				c[j]=a[j]-b[j]+58;
				if(a[j-1]==0) a[j-1]=57;
				else a[j-1]=a[j-1]-1;
			}
		}
		c[al]=0;	
		puts(c);	
	}

	return 0;
}
int main()
{
	char a[10][100],b[10][100];
	int n,i,j,lengtha[10],lengthb[10],begin;
	scanf("%d",&n);
	for(i=0;i<10;i++)for(j=0;j<100;j++){a[i][j]='\0';b[i][j]='\0';}
	for(i=0;i<10;i++){lengtha[i]=0;lengthb[i]=0;}
	for(i=0;i<n;i++)
	{
		scanf("%s",a[i]);
		scanf("%s",b[i]);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;a[i][j]!='\0';j++)lengtha[i]++;
        for(j=0;b[i][j]!='\0';j++)lengthb[i]++;
		for(j=lengthb[i]-1;j>=0;j--)b[i][j+lengtha[i]-lengthb[i]]=b[i][j];
		for(j=0;j<lengtha[i]-lengthb[i];j++)b[i][j]='0';
		for(j=lengtha[i]-1;j>=0;j--)
		{
			if(b[i][j]<=a[i][j]){a[i][j]=a[i][j]-b[i][j]+48;}
			else{a[i][j]=10+a[i][j]-b[i][j]+48;a[i][j-1]--;}
		}
		begin=0;
		for(j=0;j<lengtha[i]-1;j++){if(a[i][j]!='0'){printf("%c",a[i][j]);begin=1;}else if(begin==1)printf("%c",a[i][j]);}
		printf("%c",a[i][lengtha[i]-1]);
		printf("\n");
	}
	return 0;
}