第15天

发布时间 2023-07-16 13:46:36作者: 七安。

一、数组复制

 二、评委打分

0

package com.lianxi.www;

import java.util.Scanner;

public class 评委打分 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[6];
        int count = 0;
        for (int i = 0; i < 6; i++) {
            arr[i] = sc.nextInt();
            count += arr[i];
        }
        int min = arr[0];
        int max = arr[0];
        for (int i = 0; i < 6; i++) {
            if (arr[i] < min) {
                min = arr[i];
            }
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        count -= min;
        count -= max;
        System.out.println("最低分为:" + min + "分");
        System.out.println("最高分为:" +max+ "分");
        System.out.println("最终裁判所给的平均分为:" + count / 4 + "分");
    }
}
76
45
34
54
67
45
最低分为:34分
最高分为:76分
最终裁判所给的平均分为:52分