package lianxi; import java.util.Scanner; public class lianxi0111 { public static void main(String[] args) { // TODO 自动生成的方法存根 int a ; int sum=0; System.out.print("输入人数"); Scanner scan = new Scanner(System.in); a = scan.nextInt(); Scanner sc = new Scanner(System.in); int []arr=new int[a]; for (int i=0;i<arr.length;i++){ System.out.print("输入第"+(i+1)+"个人的成绩"); arr[i]=sc.nextInt(); sum+= arr[i]; // System.out.print("输入第"+(i+1)+"个人的成绩"); } System.out.println(); for (int j=0;j<arr.length-1;j++){ for (int k=0;k<arr.length-1;k++){ if(arr[k]>arr[k+1]){ int m=arr[k]; arr[k]=arr[k+1]; arr[k+1]=m; } } } System.out.print("最高成绩:"+arr[arr.length-1]); System.out.print("最低成绩:"+arr[0]); } }