[Baekjoon - 1546]

jjianiΒ·2021λ…„ 2μ›” 4일
0

Baekjoon

λͺ©λ‘ 보기
4/16

https://www.acmicpc.net/problem/1546

πŸ”‘ λ‚˜μ˜ 풀이

num = int(input())
scores = list(map(int, input().split()))
new = max(scores)

new_scores = []
for i in scores:
    i = ((i/new)*100)
    new_scores.append(i)

print(sum(new_scores)/num)
  • λ³΅μž‘ν•  것 κ°™μ•˜λŠ”λ° 생각보닀 κ°„λ‹¨ν•˜κ²Œ ν’€λ Έλ‹€.
  • λ¬Έμ œμ— 주어진 쑰건을 λ‹€ λ°˜μ˜ν•˜λ©΄ λ˜λŠ” λ¬Έμ œλΌμ„œ 어렡지 μ•Šμ•˜λ‹€.
  • μ²˜μŒμ— scoresλ₯Ό μ €λ ‡κ²Œ 받은 μ΄μœ λŠ” μž…λ ₯값이 '10 20 30' μ΄λ ‡κ²Œ 주어지기 λ•Œλ¬Έμ— 이것을 λΆ„λ¦¬ν•΄μ„œ int둜 ν˜•λ³€ν™˜ 후에 λ¦¬μŠ€νŠΈμ— λ‹΄κΈ°μœ„ν•΄μ„œ!
  • 파이썬의 λ‚΄μž₯ν•¨μˆ˜ 덕뢄에 μ—¬λŸ¬κ°œμ˜ for문을 λŒλ¦¬μ§€ μ•Šμ•„λ„ λ˜μ—ˆμŒ.
profile
‘Bienvenido a mi velog!🐣

0개의 λŒ“κΈ€