int CalcBit(int num)//计算num的位数{ int cnt=0; while(num/10 !=0) { num=num/10; cnt++; } cnt=cnt+1;//num的位数 return cnt;}