求大神幫忙。。。。。。
? 怎么報錯呢???
int score = 53;?
? ?int count = 0;
? ? ? ? ? System.out.println("加分前成績"+score);??
? ? ? ? // 只要成績小于60,就循環(huán)執(zhí)行加分操作,并統(tǒng)計加分次數(shù)
? ? ? ? if( int score = 53;score<=60;score++)
? ? ? ? {
? ? ? ? ? ? score=score+count;
? ? ? ? ? ? count++ ;
? ? ? ? ? ??
? ? ? ? }else
? ? ? ? {
? ? ? ? ? ? System.out.println("加分后成績"+score);
? ? ? ? ? ? System.out.println("共加了"+count+"次");
? ? ? ? }
? ? ? ??
? ? ? ??
2015-11-06
親,( int score = 53;score<=60;score++)這是for語句的格式,if語句的括號里只能是true或false,或者能判斷真假的表達(dá)式。把if改成for,去掉else和else的花括號就好了。
2015-11-06
這個需要使用循環(huán) 你沒有 你用的是if,錯誤
if的條件代碼你寫成了for的格式 錯誤
改成for的話 score不能定義在for里面不然后面不能輸出 錯誤
然后執(zhí)行的語句也有問題,當(dāng)score<=60; ? score++ ;count++; 錯誤.....
跳出循環(huán)后再執(zhí)行輸出語句........而不是else后執(zhí)行 ?所以也錯誤......
你自己再改改吧...錯的太離譜了......最好能再理解下if和for的含義和語法再來練習(xí)......