public?class?HelloWorld?{
import?java.util.Arrays;
????//完成?main?方法
????public?static?void?main(String[]?args)?{
???????int[]?scores={89,-23,64,91,119,52,73};
???????HelloWorld?hello=new?HelloWorld();
???????helllo.clas(scores);
????????
????????
????????
????}
????
????//定義方法完成成績(jī)排序并輸出前三名的功能
????
????public?void?clas(int[]scores){
????????Arrays.sort(scores);
????????int?m=0;
????????for(int?i=scores.length;i>=0;i--){
????????????if(scores[i]<0||scores[i]>100)
????????????continue;
?????????????m=m+1;
????????????System.out.println("考試成績(jī)的前三名為"+scores[i]);
????????????if(m>3)
????????????break;
????????????
????????}
??????
????}
2015-10-07
導(dǎo)入應(yīng)該在第一行
2015-10-06
hello,你寫成helllo了