'commit'
This commit is contained in:
17
TangDou/LuoGuBook/P5726.cpp
Normal file
17
TangDou/LuoGuBook/P5726.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user