不会写的看过来...献丑啦
package com.HelloWorld;
public class test {
public static void main(String[] args) {
int count=0;
int num=999;
for(int a=(num/10);a>=10;a=a/10) {
count++;
}
System.out.println("num的位数是:"+(count+2));
}
}