mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1534.cpp
This commit is contained in:
parent
1a8ecb9d80
commit
7b46c3a5c3
30
QUSTOJ/1534.cpp
Normal file
30
QUSTOJ/1534.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
while(scanf("%d",&n)==1)
|
||||
{
|
||||
vector<double> vec;
|
||||
double tmp;
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
scanf("%lf",&tmp);
|
||||
vec.push_back(tmp);
|
||||
}
|
||||
sort(vec.begin(),vec.end());
|
||||
double sum=0;
|
||||
for(int i=1;i<n-1;i++)
|
||||
{
|
||||
sum+=vec.at(i);
|
||||
}
|
||||
sum=sum/(n-2);
|
||||
printf("%.2f\n",sum);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user