728x90
반응형
문제 링크
https://www.acmicpc.net/problem/4344
4344번: 평균은 넘겠지
대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다.
www.acmicpc.net
풀이
c = int(input())
for _ in range(c):
scores = list(map(int, input().split()))
average = sum(scores[1:]) / scores[0]
cnt = 0
for i in scores[1:]:
if i > average:
cnt += 1
answer = cnt/scores[0]*100
print('%.3f' %answer + '%')
728x90
반응형
'알고리즘 정복하기! > 백준 문제풀이' 카테고리의 다른 글
백준 4673번 Python / Math (0) | 2022.02.08 |
---|---|
백준 3502번 Python / Math (0) | 2022.02.08 |
백준 1546번 Python / Math (0) | 2022.02.08 |
백준 11720번 Python / Math (0) | 2022.02.08 |
백준 10818번 Python / Math (0) | 2022.02.08 |
댓글