[Baekjoon] - 2953. 나는 요리사다

jjiani·2021년 2월 24일
0

Baekjoon

목록 보기
9/16

백준 - 문제 링크

import sys

max_total = 0
who = 0
for i in range(5):
    score = list(map(int, sys.stdin.readline().split()))
    total = sum(score)
    if max_total < total:
        max_total = total
        who = i + 1
print(who, max_total)

🔑 sum이라는 함수를 안썼다면 코드가 길어졌겠지만 함수를 사용해서 간결하게 끝낼 수 있었다.
함수 최고,,,👍👍

profile
¡Bienvenido a mi velog!🐣

0개의 댓글