求大神幫看問題在那
public class HelloWorld {
import java.util.Arrays;
??? //完成 main 方法
??? public static void main(String[] args) {
?????? ?
??????? HelloWorld hello=new HelloWorld;
??????? System.out.println("考試前三的成績?yōu)椋?);
??????? int[] scores={89,-23,64,91,119,52,73};
??????? hello.scores1(scores);
??? }
?? ?
??? //定義方法完成成績排序并輸出前三名的功能
??? public static int name(int[] age){
??????????? num=0;
??????????? for(int i=0;i<scores.lenght;i++){
??????????????? if(scores[i]>0 && scores<=100){
??????????????????? continue;
??????????????? }
??????????????? if(num>3){
??????????????????? break;
??????????????? }
??????????????? System.out.println(scores[i]);
??????????? }?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
??? }
?? ?
?? ?
?? ?
?? ?
?? ?
?? ?
?? ?
?? ?
?? ?
}
2017-04-14
import java.util.*;
import java.util.Arrays;
public class HelloWorld { ?
public void fun(){
int[] scores={89,-23,64,91,119,52,73};
Arrays.sort(scores);
int n = 0;
for(int i = scores.length-1;i>=0;i--){
System.out.println(scores[i]);
n ++;
if(n==3){
break;
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
HelloWorld hello=new HelloWorld();
? ? hello.fun(); ??
}
}
2017-04-23
不是有答案嗎?
2017-04-14
你num沒加啊,而且你功能也沒實現啊
2017-04-14