Created
January 14, 2015 21:51
-
-
Save theoremoon/13267535959bbc51d168 to your computer and use it in GitHub Desktop.
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
/* | |
* 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