Skip to content

Instantly share code, notes, and snippets.

@fpdjsns
Last active January 3, 2019 11:38
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 fpdjsns/6228f82f3e959a5beb46e2c1bb7b4cd8 to your computer and use it in GitHub Desktop.
Save fpdjsns/6228f82f3e959a5beb46e2c1bb7b4cd8 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
int t;
cin >> t;
for(int c = 1; c<=t; c++){
int n = 10;
int tmp;
int sum = 0;
int minNum = 10001;
int maxNum = -1;
while (n--) {
cin >> tmp;
sum += tmp;
minNum = min(minNum,tmp);
maxNum = max(maxNum, tmp);
}
sum -= minNum + maxNum;
printf("#%d %d\n", c, (int)((double)sum / 8 + 0.5));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment