1 package JavaApplication; 2 import java.util.Scanner; 3 import java.util.Arrays; 4 public class Scores 5 { 6 public static void main(String[] args) 7 { 8 Scanner scanner=new Scanner(System.in); 9 double scores[]=new double[4];10 System.out.println("请输入学生成绩:");11 for(int i=0;i=0;i--)23 {24 System.out.print(scores[i]+" ");25 }26 System.out.println();27 Arrays.sort(scores);28 System.out.println("最低分为:"+scores[0]);29 System.out.println("最高分为:"+scores[scores.length-1]);30 scanner.close();31 }32 }