public static void main(String[] args) {
booleanNumber();
}
public static void booleanNumber(){
Scanner sc = new Scanner(System.in);
System.out.println("请输入数字:");
int a = sc.nextInt();
if(a<0||a>9999){
System.out.println("输入错误!");
return;
}
int count=0;
while(a>0){
a /=10;
count++;
}
System.out.println("输入的是:"+count+"位数");
}
}