๐Ÿงฉ Algorithm/SWEA

[SWEA] 3314. ๋ณด์ถฉํ•™์Šต๊ณผ ํ‰๊ท  (Python/D3)

devCloud 2024. 10. 21. 17:32
728x90

[๋ฌธ์ œ ๋งํฌ] ๐Ÿ‘‡

 

SW Expert Academy

SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!

swexpertacademy.com

 


 

ํ’€์ด

40์  ๋ฏธ๋งŒ์ด๋ฉด 40์ ์„ ๋ˆ„์ ํ•˜๊ณ , 40์  ์ด์ƒ์ด๋ฉด ํ•ด๋‹น ์ ์ˆ˜๋ฅผ ๋ˆ„์ ํ•œ๋‹ค.

๋ˆ„์ ํ•œ ์ ์ˆ˜๋ฅผ 5๋กœ ๋‚˜๋ˆ„๊ณ  intํ˜•์œผ๋กœ ๋ณ€ํ™˜ํ•œ๋‹ค.

 

 

Solution

test_case = int(input())
for tc in range(1, test_case + 1):
    score = list(map(int, input().split()))
    result = 0
    for i in score:
        if i < 40:
            result += 40
        else:
            result += i
    result = int(result / 5)
    print("#%d %s" % (tc, result))

 


 

728x90