We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d286544 commit 366b960Copy full SHA for 366b960
1 file changed
luogu/ProblemSet/P5726/1.cpp
@@ -0,0 +1,28 @@
1
+#include<iostream>
2
+#include<algorithm>
3
+#include<cmath>
4
+#include<iomanip>
5
+#include<limits.h>
6
+#include<string>
7
+using namespace std;
8
+
9
+int main()
10
+{
11
+ int n;
12
+ cin >> n;
13
+ int max = 0,min = INT16_MAX;
14
+ int sum = 0;
15
+ for(int i = 0;i<n;i++)
16
+ {
17
+ int x;
18
+ cin >> x;
19
+ sum += x;
20
+ if(x > max)max = x;
21
+ if(x < min)min = x;
22
+ }
23
+ sum -= (max + min);
24
+ int average = sum / (n-2);
25
+ cout << fixed << setprecision(2) << average << endl;
26
27
+ return 0;
28
+}
0 commit comments