public static void main(String[] args){
int num = 999;
int count = 0;
for(i=1;i<=10;i++)
{ num/=10;
count=i;
if(num=0){
System.out.println("它是个"+count+"位的数");
break;
}
}
用编译器看了下
public static void main(String[]args){
int num = 999;
int count = 0;
for(int i=1;i<=10;i++)
{ num/=10;
count=i;
if( num==0){
System.out.println("它是个"+count+"位的数");
break;
}
}
}