请问这样为啥不行?
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(i=10;num/i>=1;){
count=count+1;
i=i*10;
}if(num/i<1){
break;
}
System.out.println("它是个"+count+"位的数!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(i=10;num/i>=1;){
count=count+1;
i=i*10;
}if(num/i<1){
break;
}
System.out.println("它是个"+count+"位的数!");
}
}
2022-02-01
举报