From 85528165232c3d67b569209fe2268f9d317b5ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=9C=E7=94=9F?= <476935129@qq.com> Date: Tue, 13 Apr 2021 21:28:38 +0800 Subject: [PATCH] first commit --- .../dsedfa1.java" | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 "\346\225\260\347\273\204\347\273\203\344\271\240/\350\224\241\344\270\234\347\224\237/dsedfa1.java" diff --git "a/\346\225\260\347\273\204\347\273\203\344\271\240/\350\224\241\344\270\234\347\224\237/dsedfa1.java" "b/\346\225\260\347\273\204\347\273\203\344\271\240/\350\224\241\344\270\234\347\224\237/dsedfa1.java" new file mode 100644 index 0000000..637317b --- /dev/null +++ "b/\346\225\260\347\273\204\347\273\203\344\271\240/\350\224\241\344\270\234\347\224\237/dsedfa1.java" @@ -0,0 +1,50 @@ +import java.util.Scanner; + +public class dsedfa1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("fdsafasfddasdf"); + + Scanner sc = new Scanner(System.in); + int arr[] = new int[6]; + + int max = arr[0]; + int min = arr[0]; + int sum = 0; + int index = 0; + + for (int i = 0; i < arr.length; i++) { + System.out.println("请输入分数"); + int abd = sc.nextInt(); + if (abd > 0 && abd < 100) { + arr[i] = abd; + } else { + System.out.println("输入数据不在范围"); + i--; + } + + } + + for (int i = 0; i < arr.length; i++) { + if (max > arr[i]) { + max = arr[i]; + } + } + + for (int i = 0; i < arr.length; i++) { + if (min < arr[i]) { + min = arr[i]; + } + } + + for (int i = 0; i < arr.length; i++) { + sum = arr[i] + sum; + } + int asd = sum - max - min; + + System.out.println(asd / 4); + + } + +} -- Gitee