求幫看看哪錯了?
import java.util.Arrays;
public class HelloWorld {
? ??
? ? //完成 main 方法
? ? public static void main(String[] args) {
? ? ? ? HelloWorld hello=new HelloWorld ();
? ? ? ? int []scores={89,-23,64,91,119,52,73};
? ? ? ? int scores[i]= hello.print(scores);
?System.out.println(scores[i]);
}
public int print(int []scores) {
? ? Arrays.sort(scores);
? ? ? int num=0;
? ? ? for(int i=scores.length-1;i>=o;i--){
? ? ? ? ? ?if (scores[i]>=0){
? ? ? ? ? ? ? ?if(scores<=100){
? ? ? ? ? ? ? ? ? ?if(num<3){
? ? ? ? ? ? ? ? ? ?num++;
? ? ? ? ? ? ? ?
? ? ? ? ? ?}}}else{
? ? ? ? ? ? ? ?continue;
? ? ? ? ? ?}
? ? ? ? ? ?}return ?scores[i];
? ? ? ? ? ?}
? ? ? ?}
? ? ?
2015-09-30
跟樓上的感覺差不多,還需努力,錯誤有點多了,邏輯也比較混亂,看看別的同學的源碼好好分析一下吧
2015-09-30
可以的話 建議你下載個my eclipse 然后在里面寫代碼 ?先寫出個能編譯通過的 再問其他問題
2015-09-30
想說根本看不懂你寫的代碼哈?
錯誤太多了....根本看不出你想干嘛?
比如 ?int scores[i]= hello.print(scores);?
int 是定義一個變量 ?后面跟的應該是個變量名 ?你結果跟個數組的元素,?
還帶個角標i ,i又沒有定義過.....看不下去了
2015-09-30
運行結果error: ']' expected
int scores[i]= hello.print(scores);
^
error: illegal start of expression
int scores[i]= hello.print(scores);
^
2 errors