循環語句的使用
這個次數怎么來表示?
if(int score=53;score<60;score++){
??????????? while(score>=60);{
??????????????? System.out.println("加分后的成績:score");
??????????? }
??????????????? System.out.println("共加了"60-score"次");
??????? }
???????
???????老覺得寫的有問題1唉/?????
這個次數怎么來表示?
if(int score=53;score<60;score++){
??????????? while(score>=60);{
??????????????? System.out.println("加分后的成績:score");
??????????? }
??????????????? System.out.println("共加了"60-score"次");
??????? }
???????
???????老覺得寫的有問題1唉/?????
2017-08-12
舉報
2017-08-12
首先,你if循環已經規定運行時score不能大于等于60,那么后面while循環就沒有意義,況且while循環后不能有分號,怎么執行?還有既然定義了計數器count,為啥不用呢,應該是if循環里每循環一次就執行count++。再輸出count