[python] 백준 1546번 풀이

김보현·2024년 6월 8일
0

PS

목록 보기
15/62

정답

n = int(input())
now = list(map(int, input().split()))
m = max(now)
for i in range(n):
    now[i] = now[i]/m*100
hap = sum(now)
print(hap/n)

배운점

for문을써서 평균을 구하려고 했는데,
sum을 구한 다음 int로 나눠서 프린트하면 더 간략하게 풀 수 있었다.

profile
Fall in love with Computer Vision

0개의 댓글

관련 채용 정보