给的原题目是输入一个不多于5位的整数;
要求:1.求出它是几位数。2.分别输出每一位数字;3.按逆序输出各位数字;
这个是我写的:#include<stdio.h>
void main()
{
int a,b,c,d,e,f;
printf("Please enter a five positive integers:");
scanf("%d",f);
a=f/10000;
b=(f-10000*a)/1000;
c=(f-10000*a-1000*b)/100;
d=(f-10000*a-1000*b-100*c)/10;
e=(f-10000*a-1000*b-100*c-10*d);
if(a>0) printf("It is Five digits.\n");
else
if(b>0) printf("It is Four digits.\n");
else
if(c>0) printf("It is three digits.\n");
else
if(d>0) printf("It is Two digits.\n");
else
if(e>0) printf("It is one digits.\n");
else printf("No Result.\n");
printf("a=%d,b=%d,c=%d,d=%d,e=%d\n",a,b,c,d,e);
printf("%d%d%d%d%d\n",e,d,c,b,a);
}
谁能帮帮我看下哪里错误,运行总是不对