#include<stdio.h>
int main(){
int n, m, count, temp;
count=0;
printf("Enter n:");
scanf("%d",&n);
m=n;
temp=0;
do{
temp=10*temp+m%10;
m=m/10;
}while(m!=0);
do{
printf("%d",temp%10); /* 顺序输出 */
temp=temp/10;
}while(temp!=0);
printf("\n");
temp=n;
do{
printf("%d", temp%10); /* 逆序输出 */
count++;
temp=temp/10;
}while(temp!=0);
printf("\ncount=%d\n",count); /* 位数 */
}
这个应该满足条件了,代码也很完整,应该能看懂吧,哈哈