輸出已經(jīng)是它是個(gè)3位的數(shù)! 但是不知錯(cuò)在哪
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for (int i=1;i<=2;i++)
{
? ? ? ? num=num/10;?
}
? ? count = num / 3;
? ? System.out.println("它是個(gè)"+count+"位的數(shù)!");
}
}
2016-06-16
檢查一下標(biāo)點(diǎn)符號(hào)吧!如果代碼的標(biāo)點(diǎn)符號(hào)沒問題,那么就檢查輸出語句里的標(biāo)點(diǎn)符號(hào)?。?/p>
比如你的“它是個(gè)3位的數(shù)!”后面的“!”是英文輸入法的嘆號(hào)還是中文輸入法時(shí)的嘆號(hào)。。。
因?yàn)橄到y(tǒng)只認(rèn)它固定的答案,,所以你要細(xì)致到符號(hào)