解题思路:
最后得分 = (总分 - 最高分 - 最低分) / (评分人数 - 2);
注意事项:
参考代码:import java.util.Scanner;
public class C1265 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
double min = Double.MAX_VALUE, max = 0, sum = 0, score = 0;
for(int i = 0; i < n; i++){
score = sc.nextDouble();
if(score < min)
min = score;
if(score > max)
max = score;
sum += score;
}
System.out.printf("%.2f\n", (sum - min - max)/(n-2));
}
sc.close();
}
}