为啥不是多重循环呢,貌似一个for就搞定了啊,是我哪里没考虑到吗
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int j=1;
for(;num/j>0;j*=10){
count++;
}
System.out.println("它是个"+count+"位的数!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int j=1;
for(;num/j>0;j*=10){
count++;
}
System.out.println("它是个"+count+"位的数!");
}
}
2018-09-23
举报