public static void main(String[] args) {
        //定义一个动态初始化数组,用于存储评委给的分数
        int[] scores = new int[6];

        //录入6个分数
        Scanner sc = new  Scanner(System.in);
        for (int i = 0; i < scores.length; i++) {
            System.out.println("请输入第"+(i+1)+"个分数:");
            int score = sc.nextInt();
        
            //把这个分数存入数组对应的位置
            scores[i] = score;
        }

        
        //遍历循环数组,找出最高分以及最低分
        
        int max = 0;
//初始化最小值为100
        int min = 100;
        int sum = 0;
        for (int i = 0; i < scores.length; i++) {
            if (scores[i] > max){
                max = scores[i];
            }
            if (scores[i] < min){
                min = scores[i];
            }
            //统计总分
            sum += scores[i];
        }
        //求平均分


        double result= (sum - max - min) * 1.0 / (scores.length - 2);
        System.out.println("平均分是:"+ result);
    }