代码如下: #include<stdio.h> #include<math.h> int Count(long long n)//统计n是几位的数字 { if(n == 0)//判断输入的数字是否为0,若为0则直接返回1 return 1; int tmp = 0; while(n != 0) { tmp+