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

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

請(qǐng)幫我看下我這段代碼能運(yùn)行出來(lái)么,謝謝

import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
HelloWord t=new HelloWord;
int[] e=a.ppp(1,2,-1,-5);
System.out.print(e);
}
public void ppp(int[] scores) {
System.out.print("考試成績(jī)前三名:");
Arrays.sort(scores);
for(int i=0;i<=3;i++){
if(0<=scores[i]<=100){
System.out.print(scores[i]);
}else{
System.out.print(scores[i]"該成績(jī)不符合要求");
}
}
}
}

正在回答

4 回答

不能那樣寫(xiě)的!數(shù)組賦值需要循環(huán)語(yǔ)句或者直接初始化。你是在調(diào)用ppp方法,但ppp方法卻不是給數(shù)組賦值的方法,編譯無(wú)法通過(guò)。

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

泰蘭德 提問(wèn)者

非常感謝!
2015-08-03 回復(fù) 有任何疑惑可以回復(fù)我~

ppp()方法的參數(shù)是整型數(shù)組,你這個(gè)1,2,-1,-5對(duì)應(yīng)的是各個(gè)數(shù)組元素,和ppp方法不能匹配的

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

int[] e=t.ppp(1,2,-1,-5);//我不清楚這塊可不可以這么寫(xiě),望指點(diǎn)

改成這樣int[] e = t.ppp({1,2,-1,-5});

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

import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
HelloWord t=new HelloWord;
int[] e=t.ppp(1,2,-1,-5);//我不清楚這塊可不可以這么寫(xiě),望指點(diǎn)
System.out.print("考試成績(jī)前三名:");
}
public void ppp(int[] scores) {
Arrays.sort(scores);
for(int i=scores.length-1;i>=0;i--){
if(0<=scores[i]&&scores[i]<=100){
System.out.print(scores[i]);
}else{
System.out.print(scores[i]"該成績(jī)不符合要求");
}
}
}
}

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

舉報(bào)

0/150
提交
取消

請(qǐng)幫我看下我這段代碼能運(yùn)行出來(lái)么,謝謝

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

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

幫助反饋 APP下載

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

公眾號(hào)

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