我这是不是最笨的方法
public class HelloWorld
{
public static void main(String[] args)
{
int num=999999;
int count=0;
if(num/10>0)
{
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("二位数");
}
count++; num=num/10;
if(num>0)
{
if(num<10)
System.out.println("三位数");
}
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("四位数");
}
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("五位数");
}
count++; num=num/10;
if(num>0)
{
if(num<10)
System.out.println("六位数");
}
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("七位数");
}
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("八位数");
}
count++;
num=num/10;
if(num>0)
{
if(num<10)
System.out.println("九位数");
}
}
else
{
System.out.println("一位数");
}
}
}