為什么輸出連行了
?? // 變量保存成績
??????? int score = 53;
?????? ?
??????? // 變量保存加分次數
??????? int count = 0;
??????? //打印輸出加分前成績
??????? System.out.println("加分前的成績:" +score);
????? ?
?????? ?
??????? // 只要成績小于60,就循環執行加分操作,并統計加分次數
??? while? (score < 60 ){
???????? count ++;
???????? score ++;
????? ?
???? }
????? System.out.print("加分后的成績:" + score);
???? ?
???? ?
????? System.out.println("共加了"+ count +"次!");
?? ?
??????? //打印輸出加分后成績,以
??? }
}
輸出是:
加分前成績是:53
加分后成績是:60共加了7次
2019-07-12
println
2019-06-05
明白了,因為我用的是System.out.print