#include <stdio.h>
main()
{
int n,m;
scanf("%d",&n);
m = 1;
while(n/10)
{
n/=10;
++m;
}
printf("n has %d digits\n",m);
}
C 如何判断一个数的位数
最新推荐文章于 2024-04-16 20:00:00 发布
#include <stdio.h>
main()
{
int n,m;
scanf("%d",&n);
m = 1;
while(n/10)
{
n/=10;
++m;
}
printf("n has %d digits\n",m);
}