笨人有笨办法,哈哈
public class Test10 { public static void main(String[] args){ int num=63245; int count=0; if (num/10<1){ count=1; } else if(num/100<1){ count=2; } else if(num/1000<1){ count=3; } else if(num/10000<1){ count=4; } else if(num/100000<1){ count=5; } else if(num/1000000<1){ count=6; } else if(num/10000000<1){ count=7; } else if(num/100000000<1){ count=8; } else if(num/1000000000<1){ count=9; } System.out.println(num+"是一个"+count+"位数"); } }