Last active
January 3, 2019 11:38
-
-
Save fpdjsns/6228f82f3e959a5beb46e2c1bb7b4cd8 to your computer and use it in GitHub Desktop.
[SW Expert Academy] 1984. 중간 평균값 구하기 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pw_-KAdcDFAUq&categoryId=AV5Pw_-KAdcDFAUq&categoryType=CODE
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
#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