semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int reverse(int num)
{
    int i,j,l,shang;
    i=0;
    shang=1;
    int zhuanhuan[1000];
    int jieguo;
    if(num>0)
    {
       jieguo=0;
       shang=num;
       while(shang!=0)
       {
       zhuanhuan[i]=shang%10;
       shang=shang/10;
       i++;
       }         
       j=i;
       for(i=0;i<j;i++)
       {
          for(l=0;l<i;l++)
          {
             zhuanhuan[j-i-1]=zhuanhuan[j-i-1]*10;          
          }                
          jieguo=jieguo+zhuanhuan[j-i-1];
       }
       return jieguo;
    } 
    else if(num==0) 
    {
        jieguo=0;
        return jieguo;
    }
    else
    {
      jieguo=0;
       shang=0-num;
       while(shang!=0)
       {
       zhuanhuan[i]=shang%10;
       shang=shang/10;
       i++;
       }         
       j=i;
       for(i=0;i<j;i++)
       {
          for(l=0;l<i;l++)
          {
             zhuanhuan[j-i-1]=zhuanhuan[j-i-1]*10;          
          }                
          jieguo=jieguo+zhuanhuan[j-i-1];
       }
       
       jieguo=0-jieguo;
       return jieguo;
    }
}

int main()
{
   int a,i;
   int shuru[6];
   int jieguo[6];
   
   
   for(i=0;i<6;i++)
   {
      scanf("%d",&shuru[i]);
   }
   
   for(i=0;i<6;i++)
   {
    jieguo[i]=reverse(shuru[i]);              
   }
   
    for(i=0;i<6;i++)
   {
      printf("%d\n",jieguo[i]);
   }
   
   getchar();
   getchar();
 
}
int main ()
{
	void reverse(int num);
	int num,i;
	for(i=1;i<=6;i++)
	{
		scanf("%d",&num);
		if(num>0)
			reverse(num);
		else if(num==0)
			printf("0\n");
		else
		{
			printf("-");
			reverse(-num);
		}
	}
	return 0;
}
void reverse(int num)
{
	int a;
	while(num>0)
	{
		if(num%10==0)
		{
			num/=10;
		}
		else
			break;
	}
	while(num>0)
	{
		printf("%d",num%10);
		num/=10;
	}
	printf("\n");
}
void main()
{
	char a[6][50]={0},(*p)[50],*q;
	int n,b[6]={0},*w;
	for(p=a;p<a+6;p++)
	{
		gets(p);
	}
	for(p=a,w=b;p<a+6;p++,w++)
	{
        n=strlen(p);
		if(**p=='-')
		{
		
			for(q=*p+n-1;q>*p;q--)
                *w=(*w)*10+(*q-'0');
			*w=-*w;
		}
		else
			for(q=*p+n-1;q>=*p;q--)
				*w=(*w)*10+(*q-'0');
	}
    for(w=b;w<b+6;w++)
		printf("%d\n",*w);
}
int reverse (int x)
{
	int back=0;
	int i;
	int qiang1,qiang2;// change the type of double->int
	int w; // digit number
	int m=1; // control + or -
	if(x<0)
	{
		m=-1;
		x=-x;
	}
	for(w=0;1;w++)
	{
		if(x/(pow(10,w))<10)
		{
			break;
		}
	}
	for(i=0;i<=w;i++)
	{
		qiang2=(int)pow(10,w-i);
		back+=(x%10)*qiang2;
		x=x/10;
	}
	return back*m;
}

int main()
{
	int a,i;
	for(i=0;i<6;i++)
	{
		scanf("%d",&a);
		printf("%d\n",reverse(a));
	}
	return 0;
}
int f(int x){
    int k,r=0;
    for(k=10;;k=k*10){
            if(x/k==0)
            break;
            }
    for(int j=k/10;j>0;j=j/10){
                           r+=x/j*(k/j/10);
                           x=x%j;
                           }
   return r;                         
}
int main(){
    int a[6];
    for(int i=0;i<6;i++){
            scanf("%d",&a[i]);
            }
    for(int i=0;i<6;i++){
            printf("%d\n",f(a[i]));
            }
    return 0;
}
int reverse(int n)
{
	int j,temp,flag,i,re_n,num[11];
	flag=0;
	i=0;
	while ((n>=10) || (n%10!=0))
	{
		temp=n%10;
		n=n/10;
		if ((flag==0) && (temp!=0) || (flag==1))
		{
			num[i++]=temp;
			flag=1;
		}
	}

	re_n=0;
	for (j=0;j<=i-1;j++) re_n=re_n*10+num[j];
	return(re_n);
}
void main()
{
	int flag,n;
	flag=0;
	while (scanf("%d",&n)==1) 
	{
		if (n<0) 
		{
			n=n*(-1);
			printf("-");
		}
		printf("%d\n",reverse(n));
	}
}
void main()
{
	int reverse(int num);
	int i;
	int a[6];
	for(i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++)
	{
		printf("%d\n",reverse(a[i]));
	}
}
int reverse(int num)
{
	int x[5];
	int rev;
	if(num==0){rev=0;}
	if(num>0)
	{
		if(num>9999)
		{
			x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
			x[1]=(((int)(num-x[4]-x[3]*10-x[2]*100)%10000))/1000;
			x[0]=(((int)(num-x[4]-x[3]*10-x[2]*100-x[1]*1000)%100000))/10000;
			rev=x[4]*10000+x[3]*1000+x[2]*100+x[1]*10+x[0];
		}
		if(num>999&&num<10000)
		{
			x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
			x[1]=(((int)(num-x[4]-x[3]*10-x[2]*100)%10000))/1000;
            rev=x[4]*1000+x[3]*100+x[2]*10+x[1];
		}
		if(num>99&&num<1000)
		{
            x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
            rev=x[4]*100+x[3]*10+x[2];
		}
		if(num>9&&num<100)
		{
            x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			rev=x[4]*10+x[3];
		}
		if(num>0&&num<10)
		{
			rev=num;
		}
	}
	if(num<0)
	{
		num=((-1)*num);
		if(num>9999)
		{
			x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
			x[1]=(((int)(num-x[4]-x[3]*10-x[2]*100)%10000))/1000;
			x[0]=(((int)(num-x[4]-x[3]*10-x[2]*100-x[1]*1000)%100000))/10000;
			rev=(x[4]*10000+x[3]*1000+x[2]*100+x[1]*10+x[0])*(-1);
		}
		if(num>999&&num<10000)
		{
			x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
			x[1]=(((int)(num-x[4]-x[3]*10-x[2]*100)%10000))/1000;
            rev=(x[4]*1000+x[3]*100+x[2]*10+x[1])*(-1);
		}
		if(num>99&&num<1000)
		{
            x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			x[2]=(((int)(num-x[4]-x[3]*10)%1000))/100;
            rev=(x[4]*100+x[3]*10+x[2])*(-1);
		}
		if(num>9&&num<100)
		{
            x[4]=((int)(num%10));
			x[3]=(((int)(num-x[4])%100))/10;
			rev=(x[4]*10+x[3])*(-1);
		}
		if(num>0&&num<10)
		{
			rev=(-1)*num;
		}
	}


	
	return(rev);
}
int reverse(int c)
{
	int i,j,b;
	char a[100];
	if(c>=0)
	{
		for(i=0;10*c/10>0;i++)
		{
			a[i]=c%10;
			c=c/10;
		}
		c=0;
		for(j=i-1;j>=0;j--)
		{
		
			c=c+a[j]*pow((double)10,(i-j-1));
		}
	}

	if(c<0)
	{
		b=0-c;
		for(i=0;10*b/10>0;i++)
		{
			a[i]=b%10;
			b=b/10;
		}
		b=0;
		for(j=i-1;j>=0;j--)
		{

			b=b+a[j]*pow((double)10,(i-j-1));
			
		}
		c=0-b;
	}

	return c;
}
			
		
		




int main()
{
	int a,i;
	for(i=1;i<=6;i++)
	{
		cin>>a;
		cout<<reverse(a)<<endl;
	}
	return 0;
}
int reverse (int num)
{
	int c[7],i,j;
	if (num>=0) c[0]=1;
	else {c[0]=-1;num=-num;}
	for (i=1;;i++)
	{
		for (j=0;;j++)
		{
			if ((num-j)%10==0) 
			{c[i]=j;num=((num-j)/10);break;}
		}
		if (num==0) break;
	}
	num=c[1];
	for (j=2;j<=i;j++)
	    num=(num*10+c[j]);
	num=num*c[0];
	return (num);
}
void main()
{
	int a[6],i;
	for (i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
		a[i]=reverse(a[i]);
	}
	for (i=0;i<6;i++)
		printf("%d\n",a[i]);
}
main()
{
 char num[6][1000];
 for(int i=0;i<6;i++)
 scanf("%s",num[i]);
 for(int i=0;i<6;i++)
 {
  int n;
  n=strlen(num[i]);
     if(num[i][0]=='0'||(num[i][0]=='-'&&num[i][1]=='0'))
     {printf("0");}
    else
     {
                   if(num[i][0]=='-')
                   {printf("-");   
                    while(num[i][n-1]=='0')
                    {n=n-1;}
                     for(int j=n-1;j>=1;j--)
                        {
                          printf("%c",num[i][j]);
                                                      }
                            }
      else
    {              while(num[i][n-1]=='0')
                    {n=n-1;}
      for(int j=n-1;j>=0;j--)
     {
      
      printf("%c",num[i][j]);         
                        } } }
      printf("\n");                     
                 }     
    getchar();getchar();getchar();  getchar();getchar();getchar();    getchar();getchar();getchar();    
      }
int reverse(int num)
{ int a,b,c,d,e,f;
    if(num==0){
      printf("0");}
      else if(num<0){
        num=0-num;
        printf("-");}
    a=(int)(num/10000);
    b=(int)((num%10000)/1000);
    c=(int)((num%1000)/100);
    d=(int)((num%100)/10);
    e=(int)(num%10);
    f=10000*e+1000*d+100*c+10*b+a;
    while(f%10==0){
      f=f/10;}
    return f;
}
int main(){
    int i,n,rn;
    for(i=0;i<6;i++){
      scanf("%d",&n);
      rn=reverse(n);
      printf("%d\n",rn);
      }
    return 0;
}
int reverse(int num);

int main()
{
	int i;
	int temp;
	for (i=0; i<6; i++){
		scanf("%d", &temp);
		printf("%d\n", reverse(temp));
	}

	return 0;
}

int reverse(int num)
{
	int len;
	int sign;
	int out = 0;		// Modified Unsigned
	int i;
	if (num==0) return 0;
	sign = num / abs(num);
	num = abs(num);
	len = (int)log10(num) + 1;
	for (i=0; i<len; i++)
		out += (num/(int)(pow(10, i))%10)*pow(10,len-i-1);
	return sign*out;

}
void main()
{
	int a[6];
	int i;
	int reverse(int num);
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
    for(i=0;i<6;i++)
	    reverse(a[i]);
}
int reverse(int num)
{
	int indiv,ten,hundred,thousand,ten_thousand;
	int c;
    if(num>0)
	{
		ten_thousand=num/10000;
		thousand=(int)(num-ten_thousand*10000)/1000;
		hundred=(int)(num-ten_thousand*10000-thousand*1000)/100;
		ten=(int)(num-ten_thousand*10000-thousand*1000-hundred*100)/10;
		indiv=(int)(num-ten_thousand*10000-thousand*1000-hundred*100-ten*10);
		if(num>9999)
		{
			c=indiv*10000+ten*1000+hundred*100+thousand*10+ten_thousand;
		    printf("%d\n",c);
		}
		else if(num>999)
		{
			c=indiv*1000+ten*100+hundred*10+thousand;
			printf("%d\n",c);
		}
		else if(num>99)
		{
			c=indiv*100+ten*10+hundred;
			printf("%d\n",c);
		}
		else if(num>9)
		{
			c=indiv*10+ten;
			printf("%d\n",c);
		}
		else
			printf("%d\n",indiv);

	}
	else if(num==0)
		printf("0\n");
	else
	{
		ten_thousand=abs(num)/10000;
		thousand=(int)(abs(num)-ten_thousand*10000)/1000;
		hundred=(int)(abs(num)-ten_thousand*10000-thousand*1000)/100;
		ten=(int)(abs(num)-ten_thousand*10000-thousand*1000-hundred*100)/10;
		indiv=(int)(abs(num)-ten_thousand*10000-thousand*1000-hundred*100-ten*10);
		if(abs(num)>9999)
		{
			c=indiv*10000+ten*1000+hundred*100+thousand*10+ten_thousand;
		    printf("-%d\n",c);
		}
		else if(abs(num)>999)
		{
			c=indiv*1000+ten*100+hundred*10+thousand;
			printf("-%d\n",c);
		}
		else if(abs(num)>99)
		{
			c=indiv*100+ten*10+hundred;
			printf("-%d\n",c);
		}
		else if(abs(num)>9)
		{
			c=indiv*10+ten;
			printf("-%d\n",c);
		}
		else
			printf("-%d\n",indiv);

	}
	

}
int reverse(int num)
{
    if(num==0)
    return 0;
    else
    {
    if(num>0)
    {
    int b,x=1,y=0,i,j,k,n=0;
    b=num;
    for(i=1;;i++)
    {
                 if(b%10==0)
                 y++;
                 else
                 break;
                 b=b/10;
                 }
                 b=num;
    for(i=1;;i++)
    {
                 if(b/10!=0)
                 x++;
                 else
                 break;
                 b=b/10;
                 }
                 b=num;
    int a[x],c[x];
    for(j=0;j<x;j++)
    {
                    a[j]=b;
                    b=b/10;
                    }
                    int e;
    for(k=y;k<x;k++)
    {
                    c[k]=a[k]%10;
                    e=x-k-1;
                    n+=c[k]*pow(10,e);
                    }
                    return n;
                    }
                    else
    {
    
    int b,x=1,y=0,i,j,k,n=0;
    b=-num;
    for(i=1;;i++)
    {
                 if(b%10==0)
                 y++;
                 else
                 break;
                 b=b/10;
                 }
                 b=-num;
    for(i=1;;i++)
    {
                 if(b/10!=0)
                 x++;
                 else
                 break;
                 b=b/10;
                 }
                 b=-num;
    int a[x],c[x];
    for(j=0;j<x;j++)
    {
                    a[j]=b;
                    b=b/10;
                    }
                    int e;
    for(k=y;k<x;k++)
    {
                    c[k]=a[k]%10;
                    e=x-k-1;
                    n+=c[k]*pow(10,e);
                    }
                    return (-n);
                    }
                    } 
    }
main()
{
      int n,a,b=1;
      for(b=1;b<=6;b++)
      {
      scanf("%d",&n);
      a=reverse(n);
      printf("%d\n",a);
      }
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      }
void arc()
{
	char str[10000];
	char str2[10000];
	int a,b=0,c;
	gets(str);
	a=strlen(str);
	if(a==1) putchar(str[0]);
	else
	{
		if(str[0]=='-') 
		{
			putchar(str[0]);
					}
		for(c=a-1;;c--)
		{
		    if(str[c]=='0') b++;
			else
			{
				printf("%c",str[c]);
				b++;
				break;
			}
		}
		for(;b<a;b++) 
		{
			
			if(str[a-b-1]!='-') printf("%c",str[a-b-1]);
	    }
	}
	printf("\n");
}
void main()
{
	int i=0;
	for(;i<6;i++) arc();
}
int reverse(int num){
	int fz,w,g,k,t,a;
	fz=0;
	w=0;
	if(num<=0){
		t=-1;
		num=-num;}
	else{t=1;}
		a=num;
	while(num/10>=1){
		w=w+1;
		num=num/10;
	}
	num=a;
	for(k=0;k<=w;k++){
		g=pow(10,w-k);
		fz=fz+(num%10)*g;
		num=num/10;
	}
	return t*fz;
}
int main(){
	int m,i;
	for(i=0;i<6;i++){
		scanf("%d",&m);
		printf("%d\n",reverse(m));
	}
	return 0;
}
int main()
{
    void nixu(int num,int sign);
    int i,num,sign=0;
    for(i=0;i<6;i++)
    {
        cin>>num;
        nixu (num,sign);
        cout<<endl;
    }
    return 0;
}
void nixu(int num,int sign)
{
    int sum[10000],i=0,temp,j;
    if(num==0)
    cout<<0;
    else
    {
         if(num<0)
         {
             num=0-num;
             cout<<'-';
         }
         if(num%10!=0)
         sign=1;
         if(sign!=0)
         cout<<num%10;
         if(num/10!=0)
         {
             nixu (num/10,sign);
         }
    }

}
void main()
{
	int reverse(int num);
	int a[6],b[6],i;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++){
		b[i]=reverse(a[i]);
		printf("%d\n",b[i]);
	}
}

int reverse(int num)
{
	int n;
	int i,j,k,l,m;
	if(fabs(num)>=10000){
		i=num/10000;
		j=(num-10000*i)/1000;
		k=(num-10000*i-1000*j)/100;
		l=(num-10000*i-1000*j-100*k)/10;
		m=num%10;
		n=10000*m+1000*l+100*k+10*j+i;
	}
	else if(fabs(num)>=1000){
		i=num/1000;
		j=(num-1000*i)/100;
		k=(num-1000*i-100*j)/10;
		l=num%10;
		n=1000*l+100*k+10*j+i;
	}
	else if(fabs(num)>=100){
		i=num/100;
	    j=num/10-i*10;
	    k=num%10;
	    n=100*k+10*j+i;
	}
	else if(fabs(num)>=10){
		i=num/10;
		j=num%10;
		n=10*j+i;
	}
	else
		n=num;
	
	return(n);
}
int main()
{
    void reverse(int num,int flag);
    for(int i=0;i<6;i++)
    {
        int n;
        cin>>n;
        if(n==0){cout<<'0'<<endl;}
        else
        {
            if(n<0){cout<<'-';n*=-1;}
            reverse(n,0);  //?????????
            cout<<endl;
        }
    }
    return 0;
}
void reverse(int num,int flag)  //????,flag????????
{                               //flag=0????????????   
    int c;
    c=num%10;
    if(c!=0){cout<<c;flag=1;}
    else if(c==0&&flag==1){cout<<c;}
    if((num/10)!=0)
        reverse(num/10,flag);

}
int reverse(int n);



void main()
{
	int i,c[6],d[6],x;
	for(i=0;i<6;i++)
		scanf("%d",&c[i]);
	for(i=0;i<6;i++)
	{
		x=c[i];
		d[i]=reverse(x);
		printf("%d\n",d[i]);
	}
}


int reverse(int n)
{
	int m,a[32],x,i,j,b;
	if(n==0)
		m=0;
	else
	{
		i=0;
	    j=0;
	   while(n!=0)
	{
		b=n/10;
		a[i]=n%10;
		n=b;
		i++;
		j++;
	
	}
	x=0;
	i=0;
	while(j!=0)
	{
		x=x*10+a[i];
		j--;
		i++;
	
	}
	m=x;
	}
	return(m);

}
int Reverse(int num)                             //??Reverse??
{
	int n,temp[10];                              
	int f=0,j=0,k;                               
	double l=0;
	n=abs(num);                                  //????????num????
	while(n!=0)
	{
		temp[j]=n%10;
		n=n/10;
		j++;                                     //?n????????????temp??????
	}
	for(k=j-1;k>=0;k--)
	{
		f+=temp[k]*pow(10.0,l);
		l+=1;                                    //?temp????????????,????10?????,??f??????n???
	}
	if(num>=0)return f;                          //??num??????,?????f
	else
		return -f;                               //??num????,????-f
}
int main()
{
	int n[6],i,j;                                //??6???????????
	for(i=0;i<=5;i++)
		cin>>n[i];                               //?????????
	for(j=0;j<=5;j++)
		cout<<Reverse(n[j])<<endl;               //???????
	return 0;
}
int main()
{
    int f(int m);
    int count(int m);
    int m[6];
    for(int i=0;i<=5;i++)
    {
        scanf("%d",&m[i]);
    }
    for(int j=0;j<=5;j++)
    {
        printf("%d\n",f(m[j]));
    }
}
int count(int m)
{
    int a=1;
    int i;
    for(i=0;i<=m-1;i++)
    {
        a=a*10;
    }
    return a;
}

int f(int m)
{
    if(m>0)
    {
        int i=1;
        int n=m;
        while(n/10>=1)
        {
            i++;
            n=n/10;
        }
        int *p=(int *)malloc(i*sizeof(int));
        int j;
        for(j=0;j<=i-1;j++)
        {
            p[j]=m-((int)(m/10))*10;
            m=m/10;
        }
        int k,b=0;
        for(k=0;k<=i-1;k++)
        {
            b=b+p[k]*count(i-k-1);
        }
        return b;
    }
    else if(m==0)
    {
        int c=0;
        return c;
    }
    else
    {
        int i=1,q;
        int n=q=-m;
        while(n/10>=1)
        {
            i++;
            n=n/10;
        }
        int *p=(int *)malloc(i*sizeof(int));
        int j;
        for(j=0;j<=i-1;j++)
        {
            p[j]=q-((int)(q/10))*10;
            q=q/10;
        }
        int k,b=0;
        for(k=0;k<=i-1;k++)
        {
            b=b+p[k]*count(i-k-1);
        }
        return -b;
    }

}
int reverse(int num); 
int res(int q,int w,int t);
int main(){
	int n[7],n1[7],i;
	char c;
	for(i=1;i<=6;i++){
		scanf("%d",&n[i]);
		if(n[i]<0){
			n1[i]=0-n[i];
			c='-';
		}
		else{
			n1[i]=n[i];
			c='+';
		}
		if(c=='+') printf("%d\n",reverse(n1[i]));
		if(c=='-') printf("-%d\n",reverse(n1[i]));
	}
	scanf("%d",&i);
	return 0;
}
int reverse(int num){
	int j,result;
	for(j=0;;j++){
		if(num/(int)(pow(10,j))==0){
			break;
		}
	}
	result=res(num,j,0);
	return result;
}
int res(int q,int w,int t){
	int e,r;
	e=((int)(q/pow(10,t)))%10;
	r=((int)(q/pow(10,w-t-1)))%10;
	q=q+pow(10,t)*(r-e)+pow(10,w-t-1)*(e-r);
	t++;
	if(t>=w/2) return q;
	q=res(q,w,t);
	return q;
}
int reverse(int num);        //?????
int main()
{
	int a[7];                //????????
	int i=0;
	for(i=1;i<=6;i++)
	{
		cin>>a[i];
		a[i]=reverse(a[i]);  //????????
	}
	for(i=1;i<=6;i++)
	{
		cout<<a[i]<<endl;    //?????
	}
	return 0;
}
int reverse(int num)         //??????
{
	int n=0,j=0,t;
	int shuzi[100];
	for(j=1;j<100;j++)
	{
		shuzi[j]=0;
	}
	if(num>0)
	{
		t=num;
		while(num!=0)        //?????
		{
			num=num/10;
			n++;
		}
		num=t;
		for(j=1;j<=n;j++)    //?????          
		{
			shuzi[j]=num%10;
			num=num/10;
		}
		for(j=1;j<=n;j++)    //?????          
		{
			num=shuzi[j]+num*10;
		}
	}
	if(num<0)
	{
		t=num;
		while(num!=0)
		{
			num=num/10;
			n++;
		}
		num=-t;
		for(j=1;j<=n;j++)                          
		{
			shuzi[j]=num%10;
			num=num/10;
		}
		for(j=1;j<=n;j++)                          
		{
			num=shuzi[j]+num*10;
		}
		num=(-1)*num;
	}
	return num;
}
int reverse(int num)
{
	int numnew;
	if(num==0)
		return 0;
	else 
	{
		if(num>0)
		{
			numnew=0;
			while(num>0)
			{
				numnew=numnew*10+num%10;
				num=num/10;
			}
			return numnew;
		}
		else if(num<0)
		{
			num=-num;
			numnew=0;
			while(num>0)
			{
				numnew=numnew*10+num%10;
				num=num/10;
			}
			return -numnew;
		}
	}
}
int main()
{
	int i,a[6],answer[6];
	for(i=0;i<6;i++)
	{
		cin >>a[i];
		answer[i]=reverse(a[i]);
		cout <<answer[i]<<endl;
	}
	return 0;
}
int reverse(int u){
	int a[33]={0};
	int j,k;
	int x=0;
	for(j=0;u>0;j++){
		a[j]=u%10; 

		u=u/10;
	}
	for(k=0;k<j;k++){

		x=x*10+a[k];
	}
	return x;
}


int main(){
	int n,b;
	int i;
	for(i=0;i<6;i++){
		scanf("%d",&n);
		if(i!=0){
			printf("\n");
		}
		if(n<0){
			printf("-");
			n=-n;
		}
		b=reverse(n);
		printf("%d",b);
	}
	return 0;
}
int rev(int m)
{
char s[1050];
int k=m;
int ans=0;
int i=0;
while (k>0)
{
s[i]=k%10;
k/=10;
i++;
}
i--;
int base=1;
while (s[i]==0) i--;
for (;i>=0;i--)
{
ans+=s[i]*base;
base*=10;
}
return ans;
}
main()
{
for (int kk=1;kk<=6;kk++)
{
int n,m;
scanf("%d",&n);
if (n<0) m=0-n; else m=n;
if (m==0) printf("0\n");
else 
{
m=rev(m);
if (n<0)
printf("-");
printf("%d\n",m);
}
}
}
int reverse(int n)
{
	int i,j,d[201],timer=0,neo=0,e=1;
	if(n<0)
		n*=-1;
	do
	{
		timer++;
		d[timer]=n%10;
		n/=10;
	} while(n>0);
	for(i=1;i<=timer;i++)
	{
		for(j=1;j<=timer-i;j++)
		{
			e*=10;
		}
		neo+=d[i]*e;
		e=1;
	}
	return neo;
}
int main()
{
	int n,i;
	for(i=1;i<7;i++)
	{
		scanf("%d",&n);
		if(n<0)
			printf("-");
		printf("%d\n",reverse(n));
	}
	return 0;
}
int main(){
	int reverse(int num);
	int i,num,a;
	for(i=0;i<6;i++){
		scanf("%d",&num);
		a=reverse(num);
		printf("%d\n",a);
	}
	return 0;
}
int reverse(int num){
	int z=0,a,i,j;
	if(num>=0){
		for(i=0;i<10;i++){
			a=num%10;
			num=num/10;
			z=z*10+a;
			if(num==0){
				break;
			}
		}
	}
	else{
		num=-num;
		for(j=0;j<32;j++){
			a=num%10;
			num=num/10;
			z=z*10+a;
			if(num==0){
				break;
			}
		}
		z=-z;
	}
	return z;	
}
int main()
{
    void reverse(int num);
    int num,i;
    for(i=0;i<6;i++)
    {
        cin>>num;
        reverse(num);
    }
    return 0;
}

void reverse(int num0)
{
    int num1=0,n=1;
    while(num0/n!=0)
    {n=n*10;}
    for(int i=10;i<=n;i=i*10)
    {
        num1=num1+(num0%i)/(i/10)*(n/i);
        num0=num0-num0%i;
    }
    cout<<num1<<endl;
}
int reverse(int num)
{ int i,j,a[100],m=0,d;
    d=1;
    if(num<0)
 	{ 
	    num=-num;
        d=0;
    }
	for(i=0;1;i++)
	{	
		if(num<10)
	    	break;
		a[i]=num%10;
		num=num/10;
	}
	for(j=0;j<i;j++)
	{
		m+=a[j]*(pow(10,(i-j)));
	}
	m+=num;
	if(d==0)
		return -m;
	else 
		return m;
}
int main()
{
 	int i,n,result;
	for(i=0;i<6;i++)
	{	
		scanf("%d",&n);
	    result=reverse(n);
        if(i<5)
		printf("%d\n",result);
        else
        printf("%d",result);
	}
	return 0;
}
int main()
{
    int reverse(int num);
    
    int a[6],b[6],i;
    for(i=0;i<6;i++)
     {scanf("%d",&a[i]);
    b[i] = reverse(a[i]);}
    for(i=0;i<6;i++)
    printf("%d\n",b[i]);
    getchar();
    getchar();
}
int reverse(int num) 
{
  int a[100],i,j,z=0,b=1;
    for(i=0;;i++)
     {a[i]=num%10;
      num=num/10;
      if(num==0)
      break;}
      for(j=i;j>=0;j--)
      {z= z+a[j]*b ;
       b=b*10;
       }
    return(z);
}
int reverse(int x);

int main(){
	int i,m;
	for(i=0;i<6;i++)
	{
		scanf("%d",&m);
		m=reverse(m);
		printf("%d\n",m);
	}
	return 0;
}

int reverse(int x){
	int  j,p;
	p=x;
	int q;
	for(j=0;;j++)
	{
		p=p/10;
		if(p==0)
		{
			q=j;
			break;
		}
	}
	p=0;
	for(j=0;j<q+1;j++)
	{
		p+=(x%10)*pow(10,q-j);
		x=x/10;
	}
	return p;
}
int RevNum(int n)
{   int s=0;
    if(n>=0)
    {
     while(n/10!=0)
     {
      s=n%10;
      n=n/10;
      printf("%d",s);
     }
     printf("%d\n",n);
    }       
    else
    {
     n=abs(n);
     printf("-");
     while(n/10!=0)
     {
      s=n%10;
      n=n/10;
      printf("%d",s);
     }
     printf("%d\n",n);
    }        
}
main()
{ int i=0;
  int k;
  while(i<6)
  { 
  scanf("%d",&k);
  while(k%10==0)
   {
    k=k/10;
   }
  RevNum(k);
  i++;
  }  
  
}
void reserve(int a)//?????? 
{
     int rest,yu;
     yu=a%10;//?????????
     a=a/10; 
     if (a>=1)
     {
                 cout<<yu;
                 reserve(a);
     }
     else cout<<yu<<endl;
}
int main()
{
    int input,i;//?????i???? 
    for(i=0;i<6;i++)
    {
                    cin>>input;
                    if (input<0)
                    {
                                cout<<"-";
                                input=-input;
                    }
                    for(;;)//??????0 
                    {
                           if (input%10==0) input=input/10;
                           else break;
                    } 
                    reserve(input);
    }
    cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get(); 
    return 0;
}
int reverse(int num)
{
	if(num>0)
	{
		int a[10],i,la,sum=0;
		double temp;
		for(i=0;i<=9;i++)
		{
			a[i]=-1;
		}
		for(i=0;i<=9;i++)
		{
			if(num>0)
			{
				a[i]=num%10;
				num=(int)((num-a[i])/10);
			}
		}
		for(i=0;i<=9;i++)
		{
			if(a[i]==-1)
			{
				la=i;
				break;
			}
		}
		for(i=0;i<=la;i++)
		{
			temp=pow(10.00,la-i-1);
			temp=(int)temp;
			sum=(int)(sum+a[i]*temp);
		}
		return sum;
	}
	if(num==0)
	{
		return 0;
	}
	if(num<0)
	{
		num=-num;
		return -reverse(num);
	}

}
int main()
{
	int i,num;
	for(i=1;i<=6;i++)
	{
		cin >> num;
		cout << reverse(num) << endl;
	}
	return 0;
}