SWEA
[SWEA] 3314. 보충학습과 평균 (Python/D3)
dev스카이
2024. 10. 21. 17:32
[문제 링크] 👇
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))