哪位大神找找問題,只執行了一次循環
哪里錯了呀? ? ? ? ?
int score = 53; ? ? ? ?
int count = 0; ? ? ? ?
System.out.println("加分前成績"+score); ? ? ? ?
if(score<60){ ? ? ? ? ??
?count++; ? ? ? ? ??
?score++;} ? ? ? ? ??
?System.out.println("加分后成績"+score); ? ? ? ? ??
?System.out.println("共加了"+count+"次!");
2017-02-22
你這里根本就沒有執行循環啊,if是條件語句,可以用for來循環。
2017-02-22
判斷那里應該使用while循環語句,而不是if語句
2017-02-22
if是條件判斷不是循環啊,換成while