这样有问题嘛,为什么过不了
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(int i=1;i<=1000000000;){
if(num/i>0){
count=++count;
i=i*10;
continue;
}else{
System.out.println("它是个"+count+"位的数!");
break;
}
}
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(int i=1;i<=1000000000;){
if(num/i>0){
count=++count;
i=i*10;
continue;
}else{
System.out.println("它是个"+count+"位的数!");
break;
}
}
}
}
2018-12-10
举报