第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

編程練習(xí)題

為什么這段代碼放在Myeclipse里面就不行了呢。提示有錯(cuò)誤

package newnew;


public class helloword {
?public static void main(String[] args){
?int score =53;
?int count =0;
?System.out.println("加分前成績:"+score);
?while(score>=60){
??score=score+1;
??count++;
?}
?System.out.println("加分后成績:"+score);
?System.out.println("共加了+count+次!");
}
}

錯(cuò)誤提示:Description?Resource?Path?Location?Type
The value of the local variable count is not used?helloword.java?/wenwen/src/newnew?line 6?Java Problem

正在回答

2 回答

while是當(dāng)條件滿足時(shí)執(zhí)行,應(yīng)該改為score<60,你這樣程序不滿足不能執(zhí)行,另外樓上指出了,你最后一行差標(biāo)點(diǎn)符號了~~錯(cuò)誤提示里面有說第六行

public?class?HelloWorld?{
????public?static?void?main(String[]?args)?{
????????
????????//?變量保存成績
????????int?score?=?53;?
????????
????????//?變量保存加分次數(shù)
????????int?count?=?0;???
??
?System.out.println("加分前成績:"+score);
?while(score<=60){
??score=score+1;
??count++;
?}
?System.out.println("加分后成績:"+score);
?System.out.println("共加了"+count+"次!");
}
}


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

jinghuan

寫錯(cuò)。。。是小于60,代碼錯(cuò)誤
2015-11-28 回復(fù) 有任何疑惑可以回復(fù)我~

("共加了"+count+"次!");

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Java入門第一季(IDEA工具)升級版
  • 參與學(xué)習(xí)       1167313    人
  • 解答問題       18483    個(gè)

0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始

進(jìn)入課程

編程練習(xí)題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號