Programming/Python & Data Structures
[Baekjoon/Python3] 4344번 평균은 넘겠지
HooNeee
2020. 12. 4. 17:28
[Baekjoon/Python3] 4344번 평균은 넘겠지
4344번: 평균은 넘겠지
대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다.
www.acmicpc.net
case = int(input())
for i in range(case):
stu_grade = list(map(int, input().split()))
avg = 0
avg = sum(stu_grade[1:]) / stu_grade[0]
cnt = 0
for j in stu_grade[1:]:
if j > avg:
cnt += 1
print('%.3f' %round(cnt / stu_grade[0] * 100, 3) + '%') # round 형식