package com.oracle.core;
import java.util.Arrays;
import java.util.Scanner;
public class GetInput {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int[]score=new int[8];
int sum=0;
int avg=0;
int max=0;
int min=0;
System.out.println("请输入8个小于100的整数");
for(int i=0;i<score.length;i++)
{
score[i]=scanner.nextInt();
}
System.out.println("您已输入完毕");
System.out.println("后台开始计算...");
System.out.println("3");
System.out.println("2");
System.out.println("1");
for(int i=0;i<score.length;i++)
{
sum+=score[i];
}
System.out.println("学生成绩的总分是"+sum);
avg=sum/score.length;
System.out.println("学生成绩的平均分是"+avg);
Arrays.sort(score);
System.out.println("其中最低分是"+score[0]);
System.out.println("其中最高分是"+score[score.length-1]);
}
}
运行结果: