C语言的初级问题!
?给一个不多于5位的正整数,要求:
1:求出它是几位数;
2:分别输出每一位数字;
3:按倒序输出各位数,如321,应输出123;
?
2009-11-11 17:39
2009-11-11 17:41
2009-11-11 17:55

2009-11-11 18:07

2009-11-11 18:14
2009-11-11 18:26

程序代码:#include <stdio.h>
main ()
{
int a, count = 0, w;
scanf ("%d",&a);
while (a)
{
++ count;
w = a % 10;
printf ("%d\t",w);
a /= 10;
}
puts ("\n");
printf ("%d",count);
getch ();
return 0;
}

2009-11-11 18:34
2009-11-11 18:52
我看不懂~ 。。
2009-11-11 19:00
2009-11-11 19:11