public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(int i=1;num/i>=1;i=10*i){
count++;
for (;num/i<1;i=10*i){
count++;
System.out.println("它的位数是"+count);
}
}
System.out.println("它是个"+count+"位的数!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
while(num >= 9){
num=num / 10;
count=++count;
}
System.out.println("它是个"+count+"位的数!");
}
}