Skip to content

Instantly share code, notes, and snippets.

@theoremoon
Created January 14, 2015 21:51
Show Gist options
  • Save theoremoon/13267535959bbc51d168 to your computer and use it in GitHub Desktop.
Save theoremoon/13267535959bbc51d168 to your computer and use it in GitHub Desktop.
/*
* AOJ1147: ICPC Socre Totalizer Software
* AC
*/
#include <iostream>
#include <algorithm>
using namespace std;
const int MAX_N = 100;
int pts[MAX_N];
int n;
int main() {
while (true) {
cin >> n; if (n <= 0) break;
for (int i = 0; i < n; ++i)
cin >> pts[i];
sort(pts, pts + n);
long pt = 0;
for (int i = 1; i < n-1; ++i)
pt += pts[i];
cout << pt / (n-2) << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment