這到底是哪里不對啊,瘋掉了啊
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
if(num>=0&&num<=999999999){
? ? while(num!=0){
? ? count++;
? ? num=num/10;
? ? }
? ? System.out.println("它是個"+count+"位的數!"); ??
}else{
? ? System.out.println("輸入有誤!");
}
}
}
2017-01-06
我試了一下你的代碼,程序沒錯,就是輸出?System.out.println("它是個"+count+"位的數!");這句中的!號你用的是英文的,改成中文的就對了。
2017-01-18
你把第七和第八行的代碼對調一下。
輸出那里的感嘆號中文或者英文沒有影響的。
2017-01-09
應該是系統的判斷有問題,我的代碼在Java上也可以運行,可是提交系統說有錯誤
2017-01-07
試了一下,沒問題
2017-01-06
死循環,沒有輸入