You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
346 B
17 lines
346 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
const int N = 1010;
|
|
int a[N];
|
|
|
|
int main() {
|
|
int n;
|
|
cin >> n;
|
|
for (int i = 1; i <= n; i++) cin >> a[i];
|
|
sort(a + 1, a + n + 1);
|
|
int sum = 0;
|
|
for (int i = 2; i < n; i++)sum += a[i];
|
|
double avg = 1.0 * sum / (n - 2);
|
|
printf("%.2lf", avg);
|
|
return 0;
|
|
} |