#include<stdio.h>
#define N 5
void main()
{
int num,a[N],i,j;
printf("请输入:");
scanf("%d",&num);
for(i=0;i<N&&num>0;i++)
a[i]=num%10,num/=10;
printf("输入数的位数是:%d\n",i);
printf("每位数字为:");
for(j=i-1;j>=0;j--)
printf("%d,",a[j]);
printf("\n逆序数字为:");
for(j=0;j<i;j++)
printf("%d,",a[j]);
printf("\n");
}
[此贴子已经被作者于2017-2-12 17:30编辑过]