https://www.acmicpc.net/problem/1546
n = int(input())
list = list(map(int,input().split()))
max = max(list)
new_list = []
for i in list:
new_list.append(i/max*100)
avg = sum(new_list)/n
print(avg)
코드 해석
- 가장 높은 점수를 찾기
n = int(input())
list = list(map(int,input().split()))
max = max(list)
- 이후 주어진 조건에 맞게 새로운 값들을 계산
new_list = []
for i in list:
new_list.append(i/max*100)
avg = sum(new_list)/n
'Python > BOJ' 카테고리의 다른 글
[Python] 백준 8958: OX퀴즈 (0) | 2021.09.11 |
---|---|
[Python] 백준 3052: 나머지 (0) | 2021.09.10 |
[Python] 백준 2577: 숫자의 개수 (0) | 2021.09.10 |
[Python] 백준 10818 최소, 최대 (0) | 2021.08.22 |
[Python] 백준 1110 더하기 사이클 (0) | 2021.08.21 |