Skip to content

Instantly share code, notes, and snippets.

@h54k3y
Created July 7, 2018 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h54k3y/8a62f579a1e6e15f2e7b07339a36c3bd to your computer and use it in GitHub Desktop.
Save h54k3y/8a62f579a1e6e15f2e7b07339a36c3bd to your computer and use it in GitHub Desktop.
AOJ_1147
#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;
}
@karthiikselvam
Copy link

Cin isn't Defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment