為什么不正確呢?
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int j;
j=num/10;
while(j!=0){
count++;
j=j/10;
}
count++;
System.out.println("它是個(gè)"+count+"位的數(shù)!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int j;
j=num/10;
while(j!=0){
count++;
j=j/10;
}
count++;
System.out.println("它是個(gè)"+count+"位的數(shù)!");
}
}
舉報(bào)
2017-10-13
幫你在eclipse中執(zhí)行了一下,是正確的。
過(guò)你也是在eclipse中執(zhí)行出錯(cuò)的話(huà),檢查一下你創(chuàng)建的類(lèi)(class)的名稱(chēng)是否為:HelloWorld