import java.util.Scanner;
class Score{
public void score(int[] Score){
Scanner reader=new Scanner(System.in);
for(int i=0;i<Score.length;i++){
Score[i]=reader.nextInt();
}
for(int i=0;i<Score.length-1;i++){
for(int j=0;j<Score.length-i-1;j++){
if(Score[j]>Score[j+1])
{
int temp=Score[j];
Score[j]=Score[j+1];
Score[j+1]=temp;
}
}
}
System.out.print("去掉最高分:"+Score[Score.length-1]+";去掉最低分:"+Score[0]+"。");
}
public double add(int[] Score){
double a=0;
for(int i=1;i<Score.length-1;i++){
a=a+Score[i];
}
return a/(Score.length-2);
}
}
public class Test{
public static void main(String[] args){
Scanner reader=new Scanner(System.in);
int[] s;
System.out.println("请输入评委的个数");
int x=reader.nextInt();
s=new int[x];
Score me=new Score();
System.out.println("请输入各个评委的分数:");
me.score(s);
double d=me.add(s);
System.out.println("选手最后得分是:"+d);
}
}