semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void reverse(int num)//?????????
{
	if(num==0)//?0????
		cout<<num<<endl;
	else if(num>0)
	{
		int i=0,n;
		int a[20];
		while(num!=0)//??0???????????
		{
			a[i]=num%10;
			num=num/10;
			i++;
		}
		n=i;//????
		int count=0;
		for(i=0;i<20;i++)//??????????0?????
		{
			if(a[i]==0)
				count++;
			else break;
		}
		for(i=count;i<n;i++)//?????
			cout<<a[i];
		cout<<endl;
	}
}
int main()//???
{
	int num;
	for(int i=1;i<=6;i++)
	{
		cin>>num;
		if(num<0)//??0???????????????
		{
			cout<<"-";
			reverse(-num);
		}
		else
			reverse(num);
	}
	return 0;
}
int reverse(int num)
{
	int ge=0,shi=0,bai=0,qian=0,wan=0,out;
	int sign=1;
	if(num<0) sign=-1;
	if(num==0)
	{
		out=0;
		goto end;
	}
	num=abs(num);
	wan=(int)num/10000;
	qian=(int)(num-10000*wan)/1000;
	bai=(int)(num-1000*qian-10000*wan)/100;
	shi=(int)(num-1000*qian-100*bai-10000*wan)/10;
	ge=num-10000*wan-1000*qian-100*bai-10*shi;
	
	if(num<=9) out=num*sign;
    if(num<=99&&num>=10) out=(10*ge+shi)*sign;
    if(num>99&&num<=999) out=(100*ge+10*shi+bai)*sign;
	if(num>999&&num<=9999) out=(1000*ge+100*shi+10*bai+qian)*sign;
	if(num>9999) out=(ge*10000+shi*1000+bai*100+qian*10+wan)*sign;





end:return(out);
}
void main()
{
	int i,a[6];
	for(i=0;i<=5;i++)
	scanf("%d",&a[i]);
    for(i=0;i<=5;i++)
		a[i]=reverse(a[i]);
for(i=0;i<=5;i++)
printf("%d\n",a[i]);
}
int reverse(int num);
int main()
{
	int i,a;
	for (i=1;i<=6;i++)
	{
		scanf("%d",&a);
		printf("%d\n",reverse(a));
	}
}
int reverse(int num)
{
	int abs1,zhengfu=1,ge=0,shi=0,bai=0,qian=0,wang=0,fanxu;
	if (abs(num)==0)
		return 0;
	else
		if(num<0)
		{
			zhengfu=-1;
		}
	abs1=abs(num);
	if ((10000<=abs1)&&(abs1<=32767))
	{
		ge=abs1%10;
		shi=(abs1/10)%10;
		bai=(abs1/100)%10;
		qian=(abs1/1000)%10;
		wang=(abs1/10000)%10;
		fanxu=ge*10000+shi*1000+bai*100+qian*10+wang;
	}
	if((1000<=abs1)&&(abs1<10000))
    {
		ge=abs1%10;
		shi=(abs1/10)%10;
		bai=(abs1/100)%10;
		qian=(abs1/1000)%10;
		fanxu=ge*1000+shi*100+bai*10+qian;
	}
	if((100<=abs1)&&(abs1<1000))
    {
		ge=abs1%10;
		shi=(abs1/10)%10;
		bai=(abs1/100)%10;
		fanxu=ge*100+shi*10+bai;
	}
	if((10<=abs1)&&(abs1<100))
    {
		ge=abs1%10;
		shi=(abs1/10)%10;
		fanxu=ge*10+shi;
	}
	if((1<=abs1)&&(abs1<10))
    {
		ge=abs1%10;
		fanxu=ge;
	}
	if (zhengfu==1)
		return (fanxu);
	else if (zhengfu==-1)
		return ((-1)*fanxu);
		
}
int reverse(int p)
{
	int m=0,k;
	k=abs(p);
	if (p!=0)
	{
		while (k!=0)
		{
			m=m*10+k%10;
			k=k/10;
		}
		m=m*(abs(p)/p);
	}
	else m=0;
	return m;
}
int main()
{
	int num,i;
	for (i=0;i<6;i++)
	{
		cin >>num;
		cout <<reverse(num)<<endl;
	}
	return 0;
}
void fy(char c[])
{
    long s=0,i=0,t=1;
    if(c[0]=='-'&&c[1]!='0')
    {printf("-");
    i++;}
    for(i=i;c[i]!='\0'; i++)
    {
        s=s+(c[i]-'0')*t;
        t=t*10;
    }
    printf("%d\n",s);
}

int main()
{
    int k;
    char a[1000];
    for(k=0;k<6;k++)
    {
           scanf("%s",a);
           fy(a);
    }
    return 0;
}
int reverse(int num);
int main()
{
	int a[6],i,z;
	for(i=0;i<6;i++){
	scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++){
	z=reverse(a[i]);
	if(i==0){
	printf("%d",z);
	}else{
	printf("\n%d",z);
	}
	}
	return 0;
}
int reverse(int num){
	int a=0,Num,n,m;
		Num=num;
		if(Num/10==0){
		n=0;
		}else{
		n=0;
		while(n>=0){
		Num=Num/10;
		if(Num==0){
		break;
		}
		n++;
		}
		m=n;
		while(m>=0){
		a+=num%10*pow(10,m);
		num=num/10;
		m--;
		}
		}
	return a;
}
int main()
{
    int reserve(int num);
    int num;
    int b;
    int a[6],i;
    for(i=0;i<=5;i++)
    {
            scanf("%d",&a[i]);
            num=a[i];            
            b=reserve(num);
            printf("%d\n",b);
    }
}
    int reserve(int num)
{
    int c,j,n=0,s=0;
    c=num;
    do
    {
            c=c/10;
            n++;
    }        
    while(c!=0);
    for(j=1;j<=n;j++)
    {
            c=num;
            c=c/(pow(10,(j-1)));
            c=c%10;
            s=s+c*pow(10,(n-j));
    }
    return(s);
}
void main()
{
    int i,a[6];
	int reverse(int num); 
	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 i,x[5],y=0,a,j;
		for(i=0;i<5;i++)
		{
             x[i]=num%10;
			 num=(num-x[i])/10;
		}
		for(i=4;i>=0;i--)
		{
            if(x[i]!=0) 
			{
				a=i;
			    break;
			}
		}
		for(i=a;i>=0;i--)
		{
			for(j=0;j<=i;j++)
			{
			x[a-i]=x[a-i]*10;
			}
			y=y+x[a-i];
		}
		y=y/10;
		if(num<0) y=-y;
		else y=y;
		return(y);

	}
int main(int argc, char* argv[])
{
   int i,n,a[6][2];
   int reverse(int n);
   for(i=0;i<6;i++){
        scanf("%d",&n);
a[i][0]=n;
   }
   for(i=0;i<6;i++){
        a[i][1]=reverse(a[i][0]);
   }
   for(i=0;i<6;i++){
        printf("%d\n",a[i][1]);
   }
   return 0;
}
int reverse(int n)
{
  int a,b,c,d,e;
  if(n>=-9&&n<=9){
  return (n);}
  if(n>=10&&n<=99){
  a=n/10;
  b=n%10;
  return(a+b*10);
  }
  if(n>=-99&&n<=-10){
      a=(-n)/10;
  b=(-n)%10;
  return(-(a+b*10));
  }
  if(n>=100&&n<=999){
  a=n/100;
  b=(n-100*a)/10;
  c=n%10;
  return(c*100+b*10+a);
  }
  if(n>=-999&&n<=-100){
      a=(-n)/100;
  b=((-n)-100*a)/10;
  c=(-n)%10;
  return(-(c*100+b*10+a));
  }
  if(n>=1000&&n<=9999){
  a=n/1000;
  b=(n-1000*a)/100;
  c=(n-1000*a-100*b)/10;
  d=n%10;
  return(d*1000+c*100+b*10+a);
  }
  if(n>=-9999&&n<=-1000){
  n=abs(n);
      a=n/1000;
  b=(n-1000*a)/100;
  c=(n-1000*a-100*b)/10;
  d=n%10;  
      return(-(d*1000+c*100+b*10+a));
  }
  if(n>=10000&&n<=99999){
      a=n/10000;
  b=(n-10000*a)/1000;
  c=(n-10000*a-1000*b)/100;
  d=(n-10000*a-1000*b-100*c)/10;
  e=n%10;
  return(e*10000+d*1000+c*100+b*10+a);
  }
   if(n>=-99999&&n<=-10000){
      a=(-n)/10000;
  b=((-n)-10000*a)/1000;
  c=((-n)-10000*a-1000*b)/100;
  d=((-n)-10000*a-1000*b-100*c)/10;
  e=(-n)%10;
  return(-(10000*e+1000*d+100*c+10*b+a));
  }
  
}
int reverse(int num)
{
	
	int rvs=0,i,j,a[100],numz;
	if(num==0)rvs=0;
	else 
	{
		if(num<0)numz=0-num;
		else numz=num;
		for(i=0;;i++)
		{
			a[i]=numz%10;
			numz/=10;
			if(numz<1)break;
		}
		for(j=0;j<i+1;j++)
		{
			rvs*=10;
			rvs+=a[j];	
		}
		if(num<0)rvs*=(-1);
		
	}
	return rvs;
}
int main()
{
	int n,i;
	for(i=0;i<6;i++)
	{
		scanf("%d",&n);
		printf("%d\n",reverse(n));
	}
	return 0;
}
int reverse(int a);
int R(int a);
main()
{
      int i,j,k;
      for(i=1;i<=6;i++)
      {
          scanf("%d",&j);
          k=reverse(j);
          printf("%d\n",k);
      }
}
int R(int a)
{
    int i,b,c=0;
    for(i=1;a>0;i++)
    {
       b=a%10;
       c=c*10+b;
       a=a/10;
     }
    return(c);
}
int reverse(int a)
{
    int c;
    if (a>0)
    c=R(a);
    else if (a<0)
    c=-R(-a);
    else
    c=0;
    return(c);
}
int reverse(int num)
{
	int r=0, m, n=1, s=1, i=0, j=1;
	int a, C=1;
	if(num < 0)
	{
		num = -num;
		C = 0;
	}
	while(s!=0)
	{
		j = j * 10;
		s = num / j;
		i++;           //i?num???
	}
	for(m = i; m > 0; m--)
	{
		j = j/10;
		r = r + (num/j) * n;
		n = n * 10;
		a = num/j;
		num = num - a * j;

	}
	if(C == 0)
		r = -r;
	return r;
}
int main()
{
	int i=0;
	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]));
	}
	return 0;
}
int reverse(int num)
{
	int a,b,c,d,b1,b2,b3,b4,b5,t;
	if(num==-32768) a=num;
	t=abs(num);
	if(t<10) a=num;
	else if(t>=10&&t<=99)
	{
		b1=t%10;
		b2=(t-b1)/10;
		a=b1*10+b2;
	}
    else if(t>=100&&t<=999)
	{
		b1=t%10;
		c=t%100;
		b3=(t-c)/100;
		b2=(t-100*b3-b1)/10;
		a=b1*100+b2*10+b3;
	}
    else if(t>=1000&&t<=9999)
	{
		b1=t%10;
		c=t%100;
		b=t%1000;
		b4=(t-b)/1000;
		b3=(b-c)/100;
		b2=(c-b1)/10;
		a=b1*1000+b2*100+b3*10+b4;
	}
	    else
	{
		b1=t%10;
		c=t%100;
		b=t%1000;
		d=t%10000;
		b5=(t-d)/10000;
		b4=(d-b)/1000;
		b3=(b-c)/100;
		b2=(c-b1)/10;
		a=b1*10000+b2*1000+b3*100+b4*10+b5;
	}
		return(a);
}


void main()
{
	int a[6],i;
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
	{
		if(a[i]<0) printf("%d\n",-reverse(a[i]));
		if(a[i]>=0) printf("%d\n",reverse(a[i]));
	}
}
int main ()
{
    for (int i=1;i<=6;i++)
    {
        char a[100]={0},l;
        for (int i=1;i<=50;i++)
        {
            a[i]=getchar();
            if (a[i]=='-')
            {
                a[0]='-';
                i--;
            }
            if (a[i]=='\n')
            {
                l=i-1;
                break;
            }
        }
        if (a[0]=='-')
            cout <<a[0];
        for (int i=l;i>=1;i--)
        {
            if (a[i]!='0')
            {
                l=i;
                break;
            }
        }
        for (int i=l;i>=1;i--)
        {
            cout<<a[i];
        }
        if (l==0)
            cout <<"0";
        cout <<endl;
    }
    return 0;
}
void reverse( int x )
{
	int i , j ;
	char s[10] ;
	if ( x >= 0 )
	{
		sprintf(s , "%d" , x );
		for ( i = sizeof(s)-1 ; i >= 0 ; i --)
		{
			if ( s[i] > '0' && s[i] <= '9')
			{
				for ( j = i ; j >= 0 ; j --)
					printf("%c" , s[j]);
				break ;
			}
		}
	}
	else 
	{
		printf("-");
		reverse(-x);
	}
}

int main(int argc, char* argv[])
{
	int i , num ;
	for ( i = 0 ; i < 6 ; i ++)
	{
		scanf("%d", &num);
		reverse(num);
		printf("\n");
	}
	return 0;
}
int reverse(int n)
{
    int i,j,s,a[20],t=0;
    if(n>=0)
         s=n;
    else
         s=-n;
    for(i=0;s!=0;i++)
    {
          a[i]=s%10;
          s=(s-a[i])/10;
    }
    for(j=0;j<i;j++)
    {
          t=10*t+a[j];
    }
    if(n<0)
         return -t;
    else
         return t;
}
main()
{
      int i,c[6];
      for(i=0;i<6;i++)
      {
             scanf("%d",&c[i]);
             printf("%d\n",reverse(c[i]));
      }
}
int reverse  (int num)
{
    int a[12];
    int i,j,k,p;
    if(num==0)
    {
        printf("0");
    }
    else
    {
        if(num>0)
        {
            a[0]=1;
        }
        if(num<0)
        {
           a[0]=0;
           num=0-num;
        }
        if(a[0]==0)
        {
           printf("-");
        }
        for(i=1;num!=0;i++)
        {
           a[i]=num%10;
           num=(num-a[i])/10;
        }
        a[i]=10;
        for(j=1;a[j]==0;j++)
        {
           p=1;
        }
        for(k=j;a[k]!=10;k++)
        {
           printf("%d",a[k]);
        }
        printf("\n");
    }
    return 0;
}
main()
{
    int a,i;
    for(i=1;i<=6;i++)
    {
        scanf("%d",&a);
        reverse(a);
    }
}
int fanxu(int x);                       //????
int main()
{
	int i,num[6];
	for(i=0;i<6;i++)
	{
		cin>>num[i];
	}
	for(i=0;i<6;i++)
	{
		cout<<fanxu(num[i])<<endl;      //??????
	}
	return 0;
}
int fanxu(int x)
{
	int y=0,i=0,j,a[10],temp;
	while(x!=0)                        //????????????
	{
		a[i]=x%10;
		x=x/10;
		i++;
	}
	for(j=0;j<i;j++)                   //??????????
	{
		y=10*y+a[j];
	}
	return y;
}
double i = 0;
int reverse (int n);
int main ()
{
	int  n;
	while (cin >> n)
	{
		if (n == 0)
		{
			cout <<"0"<<endl;
			continue;
		}
		if ( n < 0)
		{
			cout << "-";
			n = -n;
		}

		i = 0;

		cout << reverse (n) << endl;
	}

	return 0;
}

int reverse (int n)
{
	if (n < 10)
		return n;
	int t;
	t = reverse(n/10);
	i++;
	return (n%10) * pow(10.0,i)+ t;
}
int change(int x)
{
	int t,i;

	t=0;
	i=0;
	while(x!=0)
	{
		t=t*10+x%10;
		x=x/10;
		i++;
	}
	return(t);
}
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",change(a[i]));
}
int f(int a);
int main()
{
    int x,j,c[6];
    for(j=1;j<=6;j++)
    {
    cin>>x;
    c[j]=f(x);
    }
    
    for(j=1;j<=6;j++)
    {
                     cout<<c[j]<<endl;
    }
    
    return 0;
}

int f(int a)
{
    int i,b=0,t;
    for(i=1;a!=0;i++)
    {
                     t=a%10;
                     b=b*10+t;
                     a=a/10;
    }
    return b;
}
int main()
{
	int reverse (int n);
	int s[6]={0},z[6]={0},i;
    for (i=0;i<6;i++)
	{
		scanf("%d",&s[i]);
		z[i]=reverse (s[i]);
	    printf("%d\n",z[i]);
	}
return 0;
}
int reverse (int n)
{
	int z,t=0;
	if (n==0)
		z=0; 
	while(n!=0)
	{
        t=t*10+n%10;
        n=n/10;
	}
    if (n<0)
	{
		z=t*(-1);
	}else{
		z=t;
	}
		return z;
}
int reverse(int num){
	int i,b,k,a=1000,x=0;
	for(i=10;a>0;i=10*i,x++){
		a=num/i;
	}
	if(x==1){
		k=num;
	}
	else{
		k=(num%10);
		for(b=1;b<x;b++){
			k=k*10;
		}
		k+=reverse(num/10);
	}
	return k;
}
int main(){
	int u[10],j;
	for(j=0;j<6;j++){
		scanf("%d",&u[j]);
	}
	for(j=0;j<6;j++){
		if(u[j]==0) printf("%d\n",0);
		if(u[j]>0){
			printf("%d\n",reverse(u[j]));
		}
		if(u[j]<0){
			printf("%d\n",-reverse(-u[j]));
		}
	}
	return 0;
}
int p(int i)//??? 
{
    int s=1;
    for(int j=1;j<=i;j++)
    {
            s=s*10;
    }
    return s;
}
int size(int a)//????????
{
	int b,S=1;
	for(b=1;b<20;b++)
	{
		S=S*10;
		if(S>a)
			break;
	}
	return (b);
}
int reserve(int n)//????? 
{
    int g=0,k;
    if(n==0)//???0??????0 
    {
            g=0;
    }
    else
    {
        k=abs(n);
        int a[32];
        int i,b=size(k);
        memset(a,0,sizeof(a));
        for(i=b-1;i>=0;i--)//????? 
        {
                a[i]=k%10;
                k=k/10;
        }
        for(i=b-1;i>=0;i--)//??????0???????? 
        {
                if(a[i]!=0)
                {
                           break;
                }
        }
        for(int j=i;j>=0;j--)//???????? 
        {
                    g=g+a[j]*p(j);
        }
        if(n<0){g=-g;}//??n????g???? 
    }
    return g;
}
int main()
{
    int i=6;
    while(i--)
    {
              int n;
              cin>>n;
              int a=reserve(n);
              cout<<a<<endl;
    }
    return 0;
}
void main()
{
	int a[6],b[5],c[6],i;
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
	{
	b[0]=a[i]/10000;
	b[1]=a[i]/1000-10*b[0];
	b[2]=a[i]/100-10*b[1]-100*b[0];
	b[4]=a[i]%10;
	b[3]=(a[i]%100-b[4])/10;
	if(a[i]/10000!=0)
	c[i]=b[0]+b[1]*10+b[2]*100+b[3]*1000+b[4]*10000;
	else if(a[i]/1000!=0)
		c[i]=b[1]+b[2]*10+b[3]*100+b[4]*1000;
	else if(a[i]/100!=0)
		c[i]=b[2]+b[3]*10+b[4]*100;
	else if(a[i]/10!=0)
		c[i]=b[3]+b[4]*10;
	else c[i]=b[4];
	}
	for(i=0;i<6;i++)
		printf("%d\n",c[i]);
}
int reverse(int num)/*?????????*/
{
	int ws=0/*??*/,new_num=0,i,a=num;
int ten=1;
		while (a>0)
		{
			ws++;
			a=a/10;
		}
	for(i=0;i<ws;i++)
		ten=ten*10;
	i=1;
	ten=ten/10;
	while(ten>0)
	{
		new_num=num/ten*i+new_num;
		num=num%ten;
		i=i*10;
		ten=ten/10;
	}
	return(new_num);
}

void main()
{
	int a[6]={0},i,j;
	for(i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++)
	{
		if(a[i]<0)  printf("-%d\n",reverse(-a[i]));
		else if(a[i]>0) printf("%d\n",reverse(a[i]));
		else printf("0\n");
	}
}
int f=0;
void reserve(int num)
{
		num=abs(num);
		if((num%10)!=0){
			cout<<num%10;f = 1;
		}
		if(num%10==0&&f==1)
		{
			cout<<"0";
		}
		if(num/10 >0)
		reserve(num/10);

	
}
int main()
{
	int i,num;
	for(i=0;i<6;i++)
	{
f=0;		
cin>>num;
		if(num<0){
		num=0-num;
		cout<<"-";
		}
		reserve(num);
		cout<<endl;
	}
	return 0;
}
void main()
{
	int disorder(int n);
	int a[6],i,b[6];
	for(i=0;i<6;i++)
	{scanf("%d",&a[i]);
	b[i]=disorder(a[i]);}
	for(i=0;i<6;i++)
	{printf("%d\n",b[i]);}
}

int disorder(int n)
{
	int a,c;
    if(n>0)
	{a=n;c=0;
	while(a>0)
	{
	c=c*10+a%10;
    a/=10;}
	return c;}

	if(n<0)
	{a=-n;c=0;
	while(a>0)
	{
	c=c*10+a%10;
    a/=10;}
	return -c;}
	if(n==0)
	{return 0;}
}
int main()
{
    int reverse(int n);
    int i,n,j=0;
    int a[6];
    for(i=0;i<6;i++){
                     scanf("%d",&a[i]);
                     }
    for(i=0;i<6;i++){
                     if(a[i]<0){
                                 a[i]=0-a[i];
                                 j=reverse(a[i]);
                                 printf("-%d\n",j);
                                }
                     else {
                          j=reverse(a[i]);
                          printf("%d\n",j);
                          }
                     
                     }
    return 0;
}

int reverse(int n)
{
     int b=0,l=0;
    do{
        b=n-n/10*10;
        n=n/10;
        l=l*10+b;
    }while (n>=1);
    return l;
}
void main()
{   
	int reverse(int num); 
	int a[6],b[6];
	int i;
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
		b[i]=reverse(a[i]);
	for(i=0;i<6;i++)
		printf("%d\n",b[i]);
}
reverse(int a)
{
	int j,p,l=0,c=a,z=0;
if(a>=0)
	{
	    for(;c>0;)
		{
	    	c=c/10;
		    l++;
		}
         for(j=l-1;j>=0;j--)
		 { 
		  p=a/(int)pow(10,j);
          z=z+p*(int)pow(10,l-j-1);
		  a=a-p*pow(10,j);
		 }
	}
else 
{
	     for(;c<0;)
		 {
	     	c=c/10;
		    l++;
		 }
         for(j=l-1;j>=0;j--)
		 { 
		  p=a/(int)pow(10,j);
          z=z+p*(int)pow(10,l-j-1);
		  a=a-p*pow(10,j);
		 }
}
        return z;
}
void reverse(int a)
{
	cout<<a%10;
	if(a/10!=0)
	reverse(a/10);
}
int main()
{
	int a,i,j;
	for(i=1;i<=6;i++)
	{
		cin>>a;
		if(a>=0)
		{
			for(j=0;;j++)
			{
				if(a%10==0)
					a=a/10;
				else
					break;
			}
			reverse(a);
			cout<<endl;
		}
		else
		{
			a=-a;
			for(j=0;;j++)
			{
				if(a%10==0)
					a=a/10;
				else
					break;
			}
			cout<<"-";
			reverse(a);
			cout<<endl;
		}
	}
	return 0;
}
void turn(char *a,int n)
{
     char *p,*q;
     int i,j,t,k;
     k=n/2+n%2;
     p=a,q=a+n-1;
     for(i=0;i<=k-1;i++)
     {
                              t=*(p+i);
                              *(p+i)=*(q-i);
                              *(q-i)=t;
     }
}
main()
{
int ii;
for(ii=0;ii<=5;ii++) 
{
     char A[100];
     int i,j,count=0;
     memset(A,'\0',100);
     scanf("%s",A);
     
     if(A[0]=='-')
     {for(j=0;A[j]!='\0';j++)
      {A[j]=A[j+1];}
      printf("-");
     }
     {  
     for(i=0;A[i]!='\0';i++)
     {count++;}
     turn(A,count);
     if(A[0]=='0'&&A[1]=='\0'){printf("0");} 
     else{
              for(i=0;A[0]=='0';i++) 
              {
                           for(j=0;A[j]!='\0';j++)
                           {
                                                  A[j]=A[j+1];
                           }
              }
              for(i=0;A[i]!='\0';i++) 
              {
                          printf("%c",A[i]);
              }
         }
     }
     

     
         
     printf("\n");
}

     
}
int reverse(int num)
{
	int res;
	res=num;
	int i,j;
	int ct;
	for(j=0;;j++)
	{
		if(res<pow(10.0,j+1)&&res>=pow(10.0,j))
		{
			ct=j+1;
			break;
			printf(",");
		}
		else
		{}
	}
	int shuwei[100];
	for(i=1;i<=ct;i++)
	{
		shuwei[i-1]=res%10;
		res/=10;
	}
	int ans=0;
	for(i=1;i<=ct;i++)
	{
		ans+=shuwei[i-1]*pow(10.0,ct-i);
	}
	return ans;
}
int main()
{
	int i;
	int x,ans;
	for(i=1;i<=6;i++)
	{
		scanf("%d",&x);
		if(x!=0)
		{
			if(x>0)
			{
				ans=reverse(x);
				printf("%d\n",ans);
			}
			else
			{
				ans=-reverse(-x);
				printf("%d\n",ans);
			}
		}
		else
		{
			printf("0\n");
		}
	}
	return 0;
}
int reverse(int num)
{
  int a=0,i,b=1,j=0;
  int m[5]={0};
  for(i=0;(i<=5)&&(num!=0);i++)
  {
     m[i]=num%10;
     num=num/10;
     j++;
  }
     for(i=j-1;i>=0;i--)
     {
        a=a+m[i]*b;
        b=b*10;
     }
  return a;
}
main()
{
  int i,n,c;
  for(i=1;i<=6;i++)
  {
      scanf("%d",&n);
      c=reverse(n);
      printf("%d\n",c);
  } 
  getchar();
  getchar();
}
int main()
{
	void reserve(int num);
	int x[6],i;
	for(i=0;i<6;i++)
		scanf("%d",&x[i]);
	for(i=0;i<6;i++)
		reserve(x[i]);
	
	return 0;
}

void reserve(int a)
{
	int j,p[1000],q,m;
	if(a==0)
		printf("0");
	else 
	{if(a<0)
	{
		printf("-");
		a=-a;
	}
	for(j=0;;j++)
	{
		p[j]=a%10;
		a=a/10;
		if(a==0)
			break;
	}
	q=0;
	m=j+1;
	for(j=0;j<m;j++)
	{
		if(p[j]==0&&q==0)
			continue;
		printf("%d",p[j]);
		q=1;
	}
	}
	printf("\n");
}
void main()
{
	int reverse(int n);
	int i;
	int a[6],b[6];
	for (i=0;i<=5;i++)
		scanf("%d",&a[i]);
	for (i=0;i<=5;i++)
		b[i]=reverse(a[i]);
	for (i=0;i<=5;i++)
		printf("%d\n",b[i]);
}

int reverse(int n)
{
	int f=0,i,j,m,p,q,c[10],d[10];
	if (n>0)
	{
		p=log10(n);
		for (i=0;i<=p;i++)
		{
			q=pow(10,(p-i));
			c[i]=(n-n%q)/q;
			n=n-c[i]*q;
		}
		for (i=0;i<=p;i++)
			d[i]=c[p-i];
		for (i=0;;i++)
			if (d[i]>0) break;
		for (j=i;j<=p;j++)
			f=f+d[j]*pow(10,p-j);
	}
	else if (n==0)
		f=0;
	else
	{
		n=-n;
		p=log10(n);
		for (i=0;i<=p;i++)
		{
			q=pow(10,(p-i));
			c[i]=(n-n%q)/q;
			n=n-c[i]*q;
		}
		for (i=0;i<=p;i++)
			d[i]=c[p-i];
		for (i=0;;i++)
			if (d[i]>0) break;
		for (j=i;j<=p;j++)
			f=f+d[j]*pow(10,p-j);
		f=-f;
	}
	return(f);
}
int reverse(int num); 
void main()
{
	int a[10],i;
	int b[10];
	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 x,y,z;
	if(num<0)
	{
		x=-num;
	if(x>0&&x<10)
		return(-x);
	if(x>=10&&x<=99)
	{z=(x-(x/10)*10)*10+x/10;
	return(-z);}
	if(x>=100&&x<999)
	{z=(x-(x/10)*10)*100+(x/10-(x/100)*10)*10+x/100;
	return(-z);
	}
	if(x>=1000&&x<9999)
	{z=(x-(x/10)*10)*1000+(x/10-(x/100)*10)*100+(x/100-(x/1000)*10)*10+x/1000;
	return(-z);
	}
	if(x>=10000&&x<99999)
	{z=(x-(x/10)*10)*10000+(x/10-(x/100)*10)*1000+(x/100-(x/1000)*10)*100+(x/1000-(x/10000)*10)*10+x/10000;
	return(-z);
	}
	}
    if(num==-0||num==0)
		return(0);
	if(num>0&&num<10)
		return(num);
	if(num>=10&&num<=99)
	{   y=num;
		z=(y-(y/10)*10)*10+y/10;
	return(z);}
	if(num>=100&&num<999)
	{    y=num;
		z=(y-(y/10)*10)*100+(y/10-(y/100)*10)*10+y/100;
	return(z);
	}
	if(num>=1000&&num<9999)
	{   y=num;
		z=(y-(y/10)*10)*1000+(y/10-(y/100)*10)*100+(y/100-(y/1000)*10)*10+y/1000;
	return(z);
	}
	if(num>=10000&&num<99999)
	{    y=num;
		z=(y-(y/10)*10)*10000+(y/10-(y/100)*10)*1000+(y/100-(y/1000)*10)*100+(y/1000-(y/10000)*10)*10+y/10000;
	return(z);
	}
}
void reverse(char a[])
{int i,p;
 char t;
 if(a[0]!='-')
 {for(i=0;i<strlen(a)/2;i++)
  t=a[i],a[i]=a[strlen(a)-i-1],a[strlen(a)-i-1]=t;
  p=0;
  while(a[p]=='0') p++;
  for(i=p;i<strlen(a);i++)
  printf("%c",a[i]);
  printf("\n");}
 else
  if(a[1]=='0')  printf("0\n");
  else
  {for(i=1;i<(strlen(a)/2+1);i++)
   t=a[i],a[i]=a[strlen(a)-i],a[strlen(a)-i]=t;
   printf("-");
   p=1;
   while(a[p]=='0') p++;
   for(i=p;i<strlen(a);i++)
   printf("%c",a[i]);
   printf("\n");}

}

int main()
{int i;
 for(i=0;i<6;i++)
 {
  char *p;
  p=(char *)malloc(sizeof(char)*100);
  scanf("%s",p);
  reverse(p);
 }
}
int reverse(int);
int main()
{

	int i,in[6];
	for(i=0;i<6;i++){
		scanf("%d",&in[i]);
		if(i<5)
			getchar();
		in[i]=reverse(in[i]);
	}	
	for(i=0;i<6;i++){
		printf("%d",in[i]);
		if(i<5)
			printf("\n");
	}
	return 0;
}

int reverse(int n)
{
	int dig,i,ans=0,del;
	dig=(int)log10(abs(n));
	for(i=0;i<=dig;i++){
		del=pow(10,(dig-i));
		ans+=(int)pow(10,i)*(int)(n/del);
		n=n-((int)(n/del)*del);
	}
	if(n<0)
		ans=-ans;
	return(ans);
}
//-------------------
//     ???
//    2010/11/23
//     ???
//-------------------


int Reverse(int x); //????

int main()
{
	int n=6,i,X;
	for(i=0;i<n;i++)
	{
		cin>>X;
		cout<<Reverse(X)<<endl;
	}
	return 0;
}

int Reverse(int x)
{
	int y=0;
	if(x==0) return 0;
	while(x!=0)
	{
		y=y*10+x%10;
		x=x/10;
	}
	return y;
}
int reverse(int num)
{ int i=0,a[100],m=0,j,y=1;
 if(num<0)
 { num=-num;
 y=0;
}
	while(1)
	{	if(num<10)
	    	break;
		a[i]=num%10;
		num=num/10;
		i++;
	}
	for(j=0;j<i;j++)
	{	m+=a[j]*(pow(10,(i-j)));
	}
	m+=num;
	if(y==0)
		return -m;
	else 
		return m;
}
int main()
{int i=0,j,n;
	while(i<6)
	{	scanf("%d",&n);
		j=reverse(n);
                if(i<5)
		printf("%d\n",j);
                else
printf("%d",j);
i++;
	}
	return 0;
}
int fanxu(int n)
{
	int m,a[5];
	a[4]=n/10000;a[3]=(n/1000)%10;a[2]=(n/100)%10;a[1]=(n/10)%10;a[0]=n%10;
	if(a[4]!=0) m=10000*a[0]+1000*a[1]+100*a[2]+10*a[3]+a[4];
	else if(a[4]==0&&a[3]!=0) m=1000*a[0]+100*a[1]+10*a[2]+a[3];
    else if(a[4]==0&&a[3]==0&&a[2]!=0) m=100*a[0]+10*a[1]+a[2];
    else if(a[4]==0&&a[3]==0&&a[2]==0&&a[1]!=0) m=10*a[0]+a[1];
    else if(a[4]==0&&a[3]==0&&a[2]==0&&a[1]==0) m=n;
	return(m);
}
void main()
{
	int b[6],c[6],i;
	for(i=0;i<6;i++)
	{
	scanf("%d",&b[i]);
    c[i]=fanxu(b[i]);
	}
    for(i=0;i<6;i++)
	printf("%d\n",c[i]);
}
int reverse(int a);//??reverse??
int main()//?????
{
	int n[6],num[6],i;
	for(i=0;i<6;i++)cin>>n[i];//??????6???
	for(i=0;i<6;i++)num[i]=reverse(n[i]);//????????num??
	for(i=0;i<5;i++)cout<<num[i]<<endl;//??num????????????
	cout<<num[5];//???????
	return 0;
}//?????
int reverse(int a)//reverse??
{
	int x[100],i=0,sum=0,num=0;
	if(a>0)//?a??????
	{do//?a???????
	{
		x[i]=a%10;
		a=a/10;
		i++;num++;
	}while(a>0);
	for(i=0;i<num;i++)sum=sum*10+x[i];//???????
	}
	else if(a<0)//?a??????
	{
		a=a*(-1);//?a????????
		do//????????????
	{
		x[i]=a%10;
		a=a/10;
		i++;num++;
	}while(a>0);
	for(i=0;i<num;i++)sum=sum*10+x[i];//???????
	sum=sum*(-1);//???????????
	}
	else if(a==0&&a==-0)sum=0;//?a?0?-0????0
	return sum;//????sum
}//reverse????