錯(cuò)誤在哪兒咧?
public?class?HelloWorld?{ ????public?static?void?main(String[]?args)?{ ????????int?score?=?53;? ????????int?count?=?0; ????????System.out.println('加分前成績:'?+?score); ????????while(score?<?60){ ????????????score?=?score?+?1; ????????????count?=?count?+?1; ????????} ????????System.out.println('加分后成績:'?+?score); ????????System.out.println('共加了'?+?count?+?'次!'); ???????? ????} }
錯(cuò)誤在哪兒咧?
2016-07-12
System.out.println('加分前成績:'?+?score) 里面的單引號(hào)應(yīng)該改成雙引號(hào) 在編程的時(shí)候 打單引號(hào)的話應(yīng)該代碼下面就會(huì)有紅色波浪線報(bào)錯(cuò)的
2016-07-12
System.out.println('加分前成績:'?+?score);需用雙引號(hào),如System.out.println("加分前成績:" +?score);
2016-07-12
println里面的字符串要使用雙引號(hào)
2016-07-12
雙引號(hào)
2016-07-12
println里面的字符串要使用雙引號(hào);