import java.util.Scanner;
public class ScoreCount{
public static void main(String args[]){
System.out.println("***************************************************************");
System.out.println("******************欢迎使用计分统计系统*************************");
System.out.println("***************************************************************");
Scanner sc = new Scanner(System.in);
System.out.print("请输入评委的人数:");
int num = sc.nextInt();
float score[] = new float[num];
for(int i=1;i<=num;i++){
System.out.print("请输入第"+i+"位评委的打分:");
score[i-1] = sc.nextFloat();
}
System.out.println("********************录入结束***********************************");
System.out.println("评委打分如下:");
for(int i=0;i<score.length;i++){
System.out.print(score[i]+" ");
}
System.out.println();
float min,max;
min = max = score[0];
for(int i=1;i<score.length;i++){
if(min>score[i]) min = score[i];
if(max<score[i]) max = score[i];
}
System.out.println("去掉一个最低分:"+min);
System.out.println("去掉一个最高分:"+max);
float sum=0,avg=0;
for(int i=0;i<score.length;i++){
sum = sum+score[i];
}
sum = sum-min-max;
avg = sum/(score.length-2);
System.out.println("选手最终得分:"+avg);
}
}
public class ScoreCount{
public static void main(String args[]){
System.out.println("***************************************************************");
System.out.println("******************欢迎使用计分统计系统*************************");
System.out.println("***************************************************************");
Scanner sc = new Scanner(System.in);
System.out.print("请输入评委的人数:");
int num = sc.nextInt();
float score[] = new float[num];
for(int i=1;i<=num;i++){
System.out.print("请输入第"+i+"位评委的打分:");
score[i-1] = sc.nextFloat();
}
System.out.println("********************录入结束***********************************");
System.out.println("评委打分如下:");
for(int i=0;i<score.length;i++){
System.out.print(score[i]+" ");
}
System.out.println();
float min,max;
min = max = score[0];
for(int i=1;i<score.length;i++){
if(min>score[i]) min = score[i];
if(max<score[i]) max = score[i];
}
System.out.println("去掉一个最低分:"+min);
System.out.println("去掉一个最高分:"+max);
float sum=0,avg=0;
for(int i=0;i<score.length;i++){
sum = sum+score[i];
}
sum = sum-min-max;
avg = sum/(score.length-2);
System.out.println("选手最终得分:"+avg);
}
}