#include<iostream>
#include<iomanip>
using namespace std;
int main() {
int n;
cin >> n;
int str[1000] = { 0 };
int max = 0;
int min = 10;
for (int i = 0; i < n; i++) {
cin >> str[i];
if (str[i]>max) {
max = str[i];
}
if (str[i]<min) {
min = str[i];
}
}
double sum = 0;
for (int i = 0; i < n; i++) {
sum += str[i];
}
double x = (sum - max - min) / (n - 2);
cout << fixed << setprecision(2) << x << endl;
return 0;
}
标签:std,洛谷,int,max,深基,cin,C++,str,include
From: https://blog.csdn.net/2401_88089822/article/details/145169150