Created
July 7, 2018 04:13
-
-
Save h54k3y/8a62f579a1e6e15f2e7b07339a36c3bd to your computer and use it in GitHub Desktop.
AOJ_1147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <cmath> | |
using namespace std; | |
int main(){ | |
int n; | |
while(cin>>n){ | |
if(!n){ | |
break; | |
} | |
vector<int> score; | |
int in; | |
for(int i=0;i<n;i++){ | |
cin>>in; | |
score.push_back(in); | |
} | |
sort(score.begin(),score.end()); | |
int sum=0; | |
for(int i=1;i<score.size()-1;i++){ | |
sum+=score[i]; | |
} | |
int avr=sum/(n-2); | |
cout<<avr<<endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cin isn't Defined