Created
July 2, 2012 07:16
-
-
Save kunishi/3031641 to your computer and use it in GitHub Desktop.
ACM International Collegiate Programming Contest, Japan Domestic, 2007, Problem A
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int number; | |
int i; | |
int max, min; | |
int score; | |
int count; | |
int sum; | |
while (1) { | |
scanf("%d", &number); | |
if (number == 0) { | |
exit(0); | |
} | |
max = -1; | |
min = 10000; | |
sum = 0; | |
for (i = 0; i < number; i ++) { | |
scanf("%d", &score); | |
if (score < min) { | |
min = score; | |
} | |
if (score > max) { | |
max = score; | |
} | |
sum += score; | |
} | |
printf("%d\n", (sum - min - max)/(number - 2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment