請問下我這樣打會有什么問題嗎
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(int i=1;;i=i*10){
? ? if(num>=i){
? ? ? ? count=count+1;
? ? }else{
? ? ? ? System.out.println("它是個"+count+"位的數(shù)!");
? ? ? ? break;
? ? }
}
}
}
2019-01-04
沒毛病,for的參數(shù)可以為空