semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
int n,m,i;
int reverse(int num);
for(i=0;i<6;i++)
     {
         scanf("%d",&n);
         m=reverse(n);
         printf("%d\n",m);
     }
getchar();getchar();getchar();
}
int reverse(int num)
{
int k,p; 
p=0;
k=0;
if(num==0)
return(0);
else
     {
          if(num>0)
            {
                if(num<10)
                return(num);     
                else
                {
                    while(k==0)
                    {
                       k=num%10;
                        if(k!=0)
                        break;
                       num=num/10;
                    }
                    while(num!=0)
                      {
                         k=num%10;
                         num=num/10;
                        
                                p=p+k;
                                p=10*p;
                      }
                      return(p/10);
                }   
            }  
           else
           {
               num=-num;
              if(num<10)
                return(num);     
                else
                {
                    while(k==0)
                    {
                       k=num%10;
                        if(k!=0)
                        break;
                       num=num/10;
                    }
                    while(num!=0)
                      {
                         k=num%10;
                         num=num/10;
                        
                                p=p+k;
                                p=10*p;
                      }
                      return(-p/10);
                }   
            }
     }
}
int main()
{
	int num,i;
	int reverse(int num);
	for(i=1;i<=6;i++){
		scanf("%d",&num);
		printf("%d\n",reverse(num));
	}
	return 0;
}
int reverse(int num)
{
	int t=0,i,zf=1;
	if(num<0){
		num=-num;
		zf=-1;
	}
	for(i=1;;i++){
		t=t*10+num%10;
		if(num<10)break;
		num=num/10;
	}
	t=t*zf;
	return(t);
}
int reverse(int num);
void main()
{
	int a[6],i;
	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=0,flag=0;
	if(num<0)
	{
		flag=1;
		num=0-num;
	}
	while(num!=0)
	{
		x=num%10+x*10;
		num=num/10;
	}
	if(flag==1)x=0-x;
	return(x);
}
int f(int n);
int main()
{
	int i,m;
	for(i=0;i<6;i++)
	{
	scanf("%d",&m);
  
	printf("%d\n",f(m));

	}
	return 0;

} 
int f(int n)
	{
	    int a[10000],b[10000];
		int g,i,j;
		b[0]=abs(n);
		if(b[0]!=0)
		{
			for(i=0;;i++)
			{
			a[i]=b[i]%10;
			b[i+1]=b[i]/10;
			if(a[i]==0&&b[i+1]==0)
			{break;}
			}
    	g=0;
		for(j=i;j>=0;j--)
		{
	    	g=g+a[j]*pow(10,i-j-1);

		}
		}
		
		if(n>0)
		{	
			return(g);
		}
		if(n<0)
		{
			return((-g));
		}
		if(n=0)
		{
			return(0);
		}
		
	}
int main()
{
    void ff(char str[],int x);
    int i,k,fff;
    char str[1000];
    for(fff=1;fff<=6;fff++)
{
      cin.getline(str,100,'\n');
      k=strlen(str);
      
      int v=0;
      
      for(i=k-1;i>=0;i--)
           if(str[i]=='0') v++;
           
           else break;
       
       
      if(v==k)
         cout<<0;
      else if(v==k-1&&str[0]=='-')
             cout<<0<<endl;
      else
      {
          for(i=k-1;i>=1;i--)
              if(str[i]=='0'&&str[i-1]=='0')
              {str[i]=0,str[i-1]=0;i--;}
          else if(str[i]=='0'&&str[i-1]!='0')
                {str[i]=0;break;} 
          else break;
          
          
          k=strlen(str);
          str[k]='a';
          str[k+1]=0;
     

          if(str[0]!='-')
              ff(str,0);
          else
          {
              cout<<"-";
              for(i=0;i<=k-2;i++)
                 str[i]=str[i+1];
              str[k-1]='a';
              str[k+1]=0;
              ff(str,0); 
          }
          cout << endl;
      }
}
 
  return 0;
}
  void ff(char str[],int x)
{
    
    if(str[x]!='a')
      {
      x++;
      ff(str,x);
      x--;
      }
    if (str[x]!='a') 
        cout<<str[x];
}
int opp(int a)
{
	int num[5],i,j,rev=0;
	for(i=0;a!=0;i++)
	{
		num[i]=a%10;
		a=(a-a%10)/10;
	}
	for(j=0;j<i;j++)
	{
		rev=rev+num[j]*pow(10,i-j-1);
	}
	return rev;
}
int main()
{
	int opp(int a);
	int i;
	for(i=1;i<7;i++)
	{
		int n;
		scanf("%d",&n);
		if(n>=0)
		{
			printf("%d\n",opp(n));
		}
		else
		{
			printf("-%d\n",opp(-n));
		}
	}
	return 0;
}
int main()
{
	int num;
	int i;
	
int reverse(int num,int s);
	for(i=0;i<6;i++)
	{
		scanf("%d",&num);
		if(num<0)
		{
			num=-num;
			printf("-%d\n",reverse(num,0));
		}
		else
			printf("%d\n",reverse(num,0));
	}
	return 0;
}

int reverse(int num,int s)
{
	s=s*10+num%10;
	if(num>=10)
		return reverse(num/10,s);
	else
		return s;
}
void a(int t)
{if(t<0)
{cout<<'-';
t=-t;}
if(t>0)
{cout<<t%10;
a(t/10);}
     }
int main()
{int t[6];
int i;
for(i=0;i<6;i++)
{
cin>>t[i];
while(t[i]%10==0)
{t[i]=t[i]/10;}
a(t[i]);
cout<<endl;
}
return 0;
    }
int number(int n)
{
	int a,number=0;
	if(n>=0)
	{
	while(n!=0)
	{
		a=n%10;
		number=number*10+a;
		n=n/10;
	}
	return number;
	}
	if(n<0)
	{
		n=-n;
        while(n!=0)
		{
		 a=n%10;
		 number=number*10+a;
		 n=n/10;
		}
		return -number;
	}

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

}
// ?????.cpp : Defines the entry point for the console application.
// ??????????????????????????????main???????????????
int reverse(int num)                  //????reverse?????????????????????
{
	int a[20];
	int i=0,j=0;                      //????
	if(num>0)                         //??????????????
	{
		while(num>0)
		{
			a[i]=num%10;
			num=num/10;
			i++;
		}
		for(j=0;j<i;j++)
		{
			num=num*10+a[j];
		}
	}
	else                               //???????????????
	{
		num=num*(-1);
		while(num>0)
		{
			a[i]=num%10;
			num=num/10;
			i++;
		}
		for(j=0;j<i;j++)
		{
			num=num*10+a[j];
		}
		num=num*(-1);
	}
	return num;
}
int main()                          //?????
{
	int num[6],fan[6];
	int i=0;
	for(i=0;i<6;i++)                     //??6??
	{
		cin>>num[i];
	}
	for(i=0;i<6;i++)                       //?fan[i]???num[i]????
	{
		fan[i]=reverse(num[i]);
	}
	for(i=0;i<5;i++)                          //??
	{
		cout<<fan[i]<<endl;
	}
	cout<<fan[5];
	return 0;
}
int reserve(int num)
{
int x,y;
y=0;
if(num==0) return 0;
while(num!=0)
{
x=num%10;
y=y*10+x;
num=(num-x)/10;
}
return y;
}
main()
{
int z,i;
for(i=1;i<=6;i++)
{
scanf("%d",&z);
printf("%d\n",reserve(z));
}
}
int main()
{
int a,b,i;
int inverse(int num);
for(i=0;i<6;i++){
   scanf("%d",&a);
   if(a>=0){
   b=inverse(a);
   printf("%d\n",b);
     }else{
           b=inverse(a);
           printf("-%d\n",b);
           }      
   }
return 0;
}

int inverse(int num){
    int ge,shi,bai,qian,wan,num2,fu;
    if(num>=0){
              wan=(int)(num/1e4);
              qian=(int)((num-wan*1e4)/1000);
              bai=(int)((num-wan*1e4-qian*1e3)/100);
              shi=(int)((num-wan*1e4-qian*1e3-bai*1e2)/10);
              ge=(int)(num-wan*1e4-qian*1e3-bai*1e2-10*shi);
              if(10000<=num&&num<=99999){
              num2=(int)(wan+10*qian+1e2*bai+1e3*shi+1e4*ge);
                }else{
                      if(1000<=num&&num<=9999){
                        num2=(int)(qian+10*bai+1e2*shi+1e3*ge);
                        }else{
                              if(999>=num&&100<=num){
                                 num2=(int)(ge*1e2+shi*10+bai);
                                 }else{
                                       if(10<=num&&num<=99){
                                         num2=(int)(ge*10+shi);
                                         }else{
                                               num2=ge;
                                               }
                                       }
                              }
                      }
              }else{
              num=0-num;
              wan=(int)(num/1e4);
              qian=(int)((num-wan*1e4)/1000);
              bai=(int)((num-wan*1e4-qian*1e3)/100);
              shi=(int)((num-wan*1e4-qian*1e3-bai*1e2)/10);
              ge=(int)(num-wan*1e4-qian*1e3-bai*1e2-10*shi);
              if(10000<=num&&num<=99999){
              num2=(int)(wan+10*qian+1e2*bai+1e3*shi+1e4*ge);
                }else{
                      if(1000<=num&&num<=9999){
                        num2=(int)(qian+10*bai+1e2*shi+1e3*ge);
                        }else{
                              if(999>=num&&100<=num){
                                 num2=(int)(ge*1e2+shi*10+bai);
                                 }else{
                                       if(10<=num&&num<=99){
                                         num2=(int)(ge*10+shi);
                                         }else{
                                               num2=ge;
                                               }
                                       }
                              }
                      }
                    }
    return (num2);
    }
int reverse(int num);
int main()
{
	int num;        //????
	int i;
	for(i=0;i<6;i++)//????
	{
		cin>>num;
		cout<<reverse(num)<<endl;
	}
	return 0;
}
int reverse(int num)
{
	int change=0;   //change???????
	while(num!=0)
	{
		change=change*10+num%10;
		num/=10;
	}
	return change;
}
void min(char a[1000])
{
	char b[1000]={'\0'},c[1000]={'\0'};
	int i=0,j;
	if(a[0]!='-')
	{
		j=0;
	for(i=0;i<strlen(a);i++)
	b[strlen(a)-1-i]=a[i];	
    for(i=0;i<strlen(b);i++)
		if(b[i]!='0')
		{j=i;break;}
		if(j==strlen(b))
			c[0]='0';
		else
		{
			for(i=j;i<strlen(b);i++)
				c[i-j]=b[i];
		}
	printf("%s\n",c);
    }
	else
	{
		j=1;
	c[0]='-';
	b[0]='0';
    for(i=1;i<strlen(a);i++)
		b[i]=a[strlen(a)-i];
	for(i=1;i<strlen(b);i++)
		if(b[i]!='0')
		{j=i;break;}
	for(i=j;i<strlen(b);i++)
	c[i-j]=b[i];
	printf("-");
	printf("%s\n",c);
    }
	scanf("\n");
}
void main()
{  
	int n; 
	for(n=1;n<=6;n++)
	{
	  char a[1000]={'\0'};
	  gets(a);
      min(a);
	}
}
int reverse(int n)
{
    int i,j,k=0;
    int a[1000];
    for(i=0;;i++)
    {
                 a[i]=n%10;
                 n=n/10;
                 if(n==0) break;
    }
    j=i;
    for(i=0;i<=j;i++)
    {
                 k=k*10+a[i];
    }
    return k;
}
main()
{
      int i,n,k;
      for(i=0;i<6;i++)
      {
                      scanf("%d",&n);
                      k=reverse(n);
                      printf("%d\n",k);
      }
}
int reverse(int);
int main()
{
    int i,x;
	for(i=1;i<=6;i++)                                //???6???
	{
		cin>>x;
		reverse(x);
		cout<<endl;
	}
	return 0;
}

int reverse(int x)                                   //??????                     
{
	int i;
	int y=0;
	if(x==0)
	{
		cout<<x;
	}
	if(x>0)
	{

		for(i=0;x>0;i++)                              //??????????????0
		{
			if(x%10!=0||y!=0)
			{
				cout<<x%10;
                y=1;
			}
			x=x/10;
		}
	}
	if(x<0)                                           //???????????????????????
	{
		cout<<"-";
		for(i=0;-x>0;i++)
		{
			if(x%10!=0||y!=0)
			{
				cout<<(-x)%10;
				y=1;
			}
			x=x/10;
		}
	}
	return 0;
}
int reverse(int num)
{
    if(num==0||num==-0)
        return 0;

    int x=abs(num);
    int i=0, sum=0, sz[100];
    for(;x!=0;x/=10) 
    {
        sz[i++] = x%10;
    }

    x=i;
    for(i=0;i<x;i++)
    {
        sum+=sz[i]*pow(10,(x-i-1));
    }

    if(num<0)
        sum=-sum;

    return sum;
}

int main()
{
    int num, i;

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

    return 0;
}
int Reverse(int num);
int main()
{
    int i,num;
    for (i=1;i<=6;i++)
     {
       cin>>num; //?? 
       cout<<Reverse(num)<<endl; //???? 
     }
return 0;
} 
int Reverse(int num)
{
    int width,i,RevNum;
    width=log10((double)(abs(num)))+1;  //???? 
    i=0;RevNum=0;
    if (num>0)
    {
	    while(num>0)                          //??n???????? 
	      {i++;
	      RevNum=RevNum+(num % 10)*(int)(pow(10.0,width-i));
	       num=num/10;
	      }
        return(RevNum);
     }
     else if (num<0)
     {
	    num=-num; //?????????????? 
        while(num>0)                          //??n???????? 
	      {i++; 
	      RevNum=RevNum+(num % 10)*(int)(pow(10.0,width-i)); 
	       num=num/10;
	      }
        return(-RevNum);
     }
     else if (num==0) return 0;
}
main()
{
int n,s,c,k,i,y,t,l;
int reverse(int num);
int a[8];
for(i=0;i<6;i++)
{
scanf("%d",&n);
//if(n==0) {printf("0");}
l=reverse(n);
printf("%d\n",l);
}
getchar();
getchar();
getchar();
getchar();
}
int reverse(int num)
{
    int n,s,c,k,i,y,t,l;
    int a[8];
   s=num;
  c=1;k=1;t=0;y=0;
 for(int i=0;s!=0;i++)
 {
         s=s/10;
         c=c*10;
         a[i]=(num-s*c)/k;
         k=k*10;
       //printf("%d %d\n",a[i],i);  
          t=10*y;
        y=t+a[i];             
 
//printf("%d\n",y);

}
//printf("%d\n",y);
  num=y;
  return(num);
}
void main ( )
{
 void doc(char b[20]);
 char a[6][20],c[20];
 int i,j;
 for(i=0;i<6;i++)
 {
	 for(j=0;j<20;j++)
		 a[i][j]='0';
    gets(a[i]);
	}
  for(i=0;i<6;i++) 
  {
   if(a[i][0]=='0')
    printf("0\n"); 
   else
    if(a[i][0]=='-' && a[i][1]=='0')
     printf("-0\n");
    else
     if(a[i][0]=='-')
     {
      for(j=0;j<19;j++)
       c[j]=a[i][j+1];
          c[20]='0';
      printf("-");
      doc(c);
      printf("\n");
     }
     else
     {
      for(j=0;j<20;j++) 
       c[j]=a[i][j];
      doc(c);
      printf("\n"); 
     }
  }
}
void doc(char b[20])
{
 char *p;
 p=b;
 p=p+19;
 while(*p=='\0' || *p=='0')
 {
  p=p-1; 
  if(*p!='0' && *p!='\0')
   break;
 }
 for(p=p;p>=b;p--)
  printf("%c",*p);
}
int main()
{
	int n,i,j,r,p=0,y,r1,t=0;
	char q[6][100];
	char ch[100]={0},ch1[100]={0};
	for(i=0;i<=5;i++)
	{
		gets(q[i]);
		r=strlen(q[i]);
		if(q[i][0]>=48&&q[i][0]<=57)
		{
			for(j=0;j<=r-1;j++)
			{
				ch[r-1-j]=q[i][j];
			}
		}
		if(q[i][0]=='-'&&q[i][1]!='0')
		{
			for(j=1;j<=r-1;j++)
			{
				ch[r-j]=q[i][j];
			}
			ch[0]=q[i][0];
		}
		if(q[i][0]=='-'&&q[i][1]=='0') 
		{ch[0]=q[i][1];}
		r1=strlen(ch);
		if(ch[0]=='0'&&r1==1) {ch1[0]=ch[0];}
		else
		{
			if(ch[0]=='-')
			{
				for(y=1;y<=r1-1;y++)
				{
					if(ch[1]!='0') {break;}
					if(ch[y]=='0') {p++;}
					if(ch[y+1]!='0') {break;}
				}
				for(int y1=p+1;y1<=r1-1;y1++)
				{
					ch1[0]=ch[0]; ch1[t+1]=ch[y1]; t++;
				}
			}
			else
			{
				for(int x=0;x<=r1-1;x++)
				{
					if(ch[x]!='0') {break;}
					if(ch[x]=='0') {p++;}
					if(ch[x+1]!='0') {break;}
				}
				for(int x1=p;x1<=r1-1;x1++)
				{
					ch1[t]=ch[x1]; t++;
				}
			}
		}
		puts(ch1);
	    p=0;
		t=0;
	for(int x=0;x<=99;x++)
	{
		ch[x]='\0'; 
		ch1[x]='\0';
	}
	}
	return 0;
}
int reverse(int num)
{
	int m,b=0,temp=0;
	if(num==0||num==-0)
		m=0;
	else
	{
		if(num<0)
		{
			num=-num;
			temp=1;
		}
		while(num%10==0)
		{
			num=num/10;
		}
		while(num!=0)
        {
		
			b=b*10+num%10;
		    num=num/10;
		}	
		if(temp==0)
			m=b;
		else m=-b;
	}
		return(m);
}

void main()
{
	int n,i;
	for(i=1;i<=6;i++){
		scanf("%d",&n);
		printf("%d\n",reverse(n));}
}
int fx(int n)
{
    int t=0;
    do
    {
        t=t*10+n%10;
        n/=10;
    }
    while(n!=0);
    return t;
}
int ab(int n)
{
    if(n<0)
    return -ab(-n);
    return fx(n);
}
int main()
{
    int i,t;
    scanf("%d",&t);
    printf("%d",ab(t));
    for(i=1;i<=5;i++)
    {
                     scanf("%d",&t);
    printf("\n%d",ab(t));
    }
   // getch();
    return 0;
}
int cifang(int n)
{   
    int t=1,i;
    if(n==0)
    return t;
    else
    {
    for(i=n;i>0;i--)
    t=t*10;
    return t;
    }
}
int reverse(int num)
{
    int i,j,count=0,t,total=0;
    int a[500],b[500];

    for(i=0;;i++)
    {
                 t=0;
                 t=num%cifang(i+1);
                 a[i]=t/cifang(i);
                 count++;
                 num=num-a[i]*cifang(i);
                 if(num==0) break;
    }
    
    for(i=0;i<count;i++)
    total=total+a[i]*cifang(count-i-1);
    if(total==-0)
    return total=0;
    else
    return total;
}
main()
{
      for(int i=6;i>0;i--)
      {
      int n;
      scanf("%d",&n);
      reverse(n);
     printf("%d\n",reverse(n));
     }
      getchar();
      getchar();
}
main()
{
      int reverse(int num);
      int a[6],i;
      for(i=0;i<=5;i++)
      scanf("%d",&a[i]);
      for(i=0;i<=5;i++)
      {
                           if(i==0) 
                              printf("%d",reverse(a[i]));
                              else
                              printf("\n%d",reverse(a[i]));
                              }
      getchar();
      getchar();
}
int reverse(int num)
{
    int a=num,x,b=0;
    for(;a!=0;)
    {
           x=a%10;
           a=a/10;
           b=x+b*10;
         
     }
       return(b);
}
void main()
{
  int reverse(int num);
  int a,b,i;
  for(i=0;i<6;i++)
   {
    scanf("%d",&a);
    b=reverse(a);
    printf("%d\n",b);
    }   
}

int reverse(int num)
{
    int num1,n,c1,c2,c3,c4,c5;
    if(num/10000) {c1=num/10000;c2=(num/1000)%10;c3=(num/100)%10;c4=(num/10)%10;c5=num%10; num1=c1+c2*10+c3*100+c4*1000+c5*10000;}
     else if(num/1000) {c1=num/1000;c2=(num/100)%10;c3=(num/10)%10;c4=(num%10); num1=c1+c2*10+c3*100+c4*1000;}
     else if(num/100) {c1=num/100;c2=(num/10)%10;c3=num%10; num1=c1+c2*10+c3*100;}
     else if(num/10) {c1=num/10;c2=num%10; num1=c1+c2*10;}
     else num1=num;
    return(num1);
}
int invert (int a)
{
	int b,c=0,i,j;
	if (a>=0)
		b=a;
	if (a<0)
		b=-a;
	while (b>0)
	{
		c=c*10+b%10;
		b=b/10;
	}
	if (a>=0)
		c=c;
	if (a<0)
		c=-c;
	return c;
}

void main ()
{
	int i,a[6];
	for (i=0;i<6;i++)
		scanf("%d",&a[i]);
	for (i=0;i<6;i++)
		printf("%d\n",invert(a[i]));
}
void reverse(char a[10]){
    int i=0,k=0,s=0;
    char b[10];
    
    if(strcmp(a,"0")==0){
       printf("0\n");return;}
       
    if(strcmp(a,"-0")==0){
       printf("0\n");return;}
    
    if(a[0]=='-'){
       
       printf("-");
       k=1;
    }
    
    for(i=0;i<strlen(a)-k;++i){
        if(a[strlen(a)-1-i]=='0' && s==0)
           continue;
        else 
           s=1;
        b[i]=a[strlen(a)-1-i];
        printf("%c",b[i]);
    }
    printf("\n");
    //printf("reverse: %s\m",b);
}

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

	return 0;
}
void echo(int n)
{
    cout<<n%10;
    n=n/10;
    if(n>0)
    echo(n);

}
int fanxu(int x);
int main(int argc, char* argv[])
{
	int n=0,t=0;
	while(1)
	{
		scanf("%d",&n);
		if(n>=0)
		{
			n=fanxu(n);
		}
		else
		{
			n=-1*n;
			n=fanxu(n);
			n=-1*n;
		}
		printf("%d\n",n);
		t++;
		if(t==6) break;
	}
	return 0;
}
int fanxu(int x)
{
	int sz[5],y=0,i=0;
	sz[0]=x%10;
	sz[1]=(x%100)/10;
	sz[2]=(x%1000)/100;
	sz[3]=(x%10000)/1000;
	sz[4]=x/10000;
	y=sz[0]*10000+sz[1]*1000+sz[2]*100+sz[3]*10+sz[4];
	for(i=1;i<=5;i++)
	{
		if(y%10==0)
		{
			y=y/10;
		}
	}
	return y;
}
void main()
{
	int a[6],i;
	int rvs(int x);
	for(i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++)
	{
		a[i]=rvs(a[i]);
		printf("%d\n",a[i]);
	}
}

int rvs(int x)
{
	int z[5],sign,j,y;
	if(x<0)sign=-1;
	else if(x==0)sign=0;
	else sign=1;
	x*=sign;//??x???
	for(j=4;j>=0;j--)
	{
		z[j]=x-x/10*10;//????
		x/=10;
	}
	y=sign*(10000*z[4]+1000*z[3]+100*z[2]+10*z[1]+z[0]);
	for(j=0;j<5;j++)
	{
		if(z[j]==0)y/=10;//?????0
		if(z[j]!=0)break;//??01230????2?10???????
	}
	return(y);
}
int reverse(int num)
{   
	int n,m,out;
	int a,b,c,d,e,f;
	m=abs(num);
	if(m<10)n=1;
	if(10<=m&&m<100)n=2;
    if(100<=m&&m<1000)n=3;
	if(1000<=m&&m<10000)n=4;
	if(10000<=m&&m<100000)n=5;
	if(100000<=m&&m<1000000)n=6;

	a=m%10;
	b=((m-a)%100)/10;
	c=((m-a-b*10)%1000)/100;
	d=((m-a-b*10-c*100)%10000)/1000;
	e=((m-a-b*10-c*100-d*1000)%100000)/10000;
	f=((m-a-b*10-c*100-d*1000-e*10000)%1000000)/100000;
    switch(n)
	{
	case 1:out=a;break;
	case 2:out=b+a*10;break;
	case 3:out=c+b*10+a*100;break;
	case 4:out=d+c*10+b*100+a*1000;break;
	case 5:out=e+d*10+c*100+b*1000+a*10000;break;
	case 6:out=f+e*10+d*100+c*1000+b*10000+a*100000;break;
	}
	return(out);
}
void main()
{
	int a[6],i,ou[6];
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
	{
		if(a[i]>=0)
			printf("%d\n",ou[i]=reverse(a[i]));
		else
			printf("%d\n",ou[i]=-reverse(a[i]));
	}
}
int reverse(int num);
int main()
{
	int n;
	while (cin >>n)
	{
	   if (n<0) {cout <<"-";n=-n;}
	   while (n%10==0&&n!=0)
	     n=n/10;
       reverse(n);
	}

	return 0;
}
int reverse(int num)
{
    cout <<num%10;
	if (num/10!=0)
		reverse(num/10);
	else cout <<endl;
	return 0;
}
main()
{
	int reverse(int num);
	int n,i;
	for(i=0;i<6;i++)
	{
		scanf("%d",&n);
		printf("%d\n",reverse(n));
	}


}
int reverse(int num)
{
	int rev=0;
	if(num>=0)
	{
		while(num)
		{
			rev=rev*10+num%10;
			num=num/10;
		}
	}
	else
	{
		int fan=-num;
		while(fan)
		{
			rev=rev*10+fan%10;
			fan=fan/10;
		}
		rev=-rev;
	}
	return rev;
}
int reverse(int num)
{
    int a[20],i,j,k=1,r=0,m=1;
    for(i=0;num%k!=num;i++)
    {
      k=k*10;
      a[i]=(num%k-num%(k/10))/(k/10);
    }
    for(j=0;j<i;j++)
    {
      m=m*10;
      r+=a[j]*(k/m);
    }
    return r;
}
main()
{
    int a[6],i;
    for(i=0;i<6;i++)
    {
      scanf("%d",&a[i]);
      if(a[i]==0)
        printf("0\n");
      else if(a[i]<0)
        printf("%d\n",reverse(a[i]*(-1))*(-1));
      else 
        printf("%d\n",reverse(a[i]));
    }
    getchar();
    getchar();
        
        
}