如标题
int num = 999;
int count = 0;
if(num>=0 && num<=999999999){
for(count=1;(num/=10)>0;){
count++;
}
System.out.println("它是个"+count+"位的数!");