這個哪錯了?
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
? ? ? ? // 變量保存成績
? ? ? ? int score = 53;?
? ? ? ??
? ? ? ? // 變量保存加分次數(shù)
? ? ? ? int count = 0;
? ? ? ? //打印輸出加分前成績?
? ? ? ? ? System.out.println("加分前成績:score");
? ? ? ?
? ? ? ??
? ? ? ? // 只要成績小于60,就循環(huán)執(zhí)行加分操作,并統(tǒng)計加分次數(shù)
? ? ? ? for(score<60){
? ? ? ? ? ? score++
? ? ? ? ? ? count++
? ? ? ? }
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ? //打印輸出加分后成績,以及加分次數(shù)
? ? ? System.out.println("輸出成績+score");
? ? ? System.out.println("輸出次數(shù)+count");
? ? }
}
2018-11-22
好多符號都沒有打,比如輸出的“”和+的位置問題,for循環(huán)的;其實本題用while更好。
2018-11-22
for(;score<60;){
? ? ? ? ? ? score++;
? ? ? ? ? ? count++;
? ? ? ? }
? ? ? ??
2018-11-21
for(;score<60;score++)
{count++;}
2018-11-21
不應(yīng)該用for? 應(yīng)該是if? ?
?? ? ? for(score<60){
? ? ? ? ? ? score++
? ? ? ? ? ? count++
? ? ? ? }
? ? ? ??
score++后缺少;