#include <iostream>using namespace std;int n, i, temp, sum, a[100];int main() {    cin >> n;    for (i = 1; i <= n; i++)        cin >> a[i];    for (i = 1; i <= n - 1; i++)        if (a[i] > a[i + 1]) {            temp = a[i];            a[i] = a[i + 1];            a[i + 1] = temp;        }    for (i = n; i >= 2; i--)        if (a[i] < a[i - 1]) {            temp = a[i];            a[i] = a[i - 1];            a[i - 1] = temp;        }    sum = 0;    for (i = 2; i <= n - 1; i++)        sum +  = a[i];    cout << sum / (n - 2) << endl;    return 0;}

输入: 8 40 70 50 70 20 40 10 30 输出:_______

填写答案