#include <stdio.h>
void main ()
{
int a,b,c,d,e,h;
int n;
printf("输入一个小于6位的整数:");
scanf("%d",&n);
a=n/10000;
b=n%10000/1000;
c=n%1000/100;
d=n%100/10;
e=n%10;
if(a!=0) h=5;
else if(b!=0) h=4;
else if(c!=0) h=3;
else if(d!=0) h=2;
else if(e!=0) h=1;
else h=0;
printf("%ld是%d位数\n",n,h);
switch(h)
{
case 5: printf("原序为%d%d%d%d%d\n",a,b,c,d,e);
printf("逆序输出为%d%d%d%d%d\n",e,d,c,b,a);
break;
case 4: printf("原序为%d%d%d%d\n",b,c,d,e);
printf("逆序输出为%d%d%d%d\n",e,d,c,b);
break;
case 3: printf("原序为%d%d%d\n",c,d,e);
printf("逆序输出为%d%d%d\n",e,d,c);
break;
case 2: printf("原序为%d%d\n",d,e);
printf("逆序输出为%d%d\n",e,d);
break;
case 1: printf("原序为%d\n",e);
printf("逆序输出为%d\n",e);
break;
default:printf("无输出\n");
}
}