题解 | 最厉害的学生
最厉害的学生
https://www.nowcoder.com/practice/b6e7a9ca04d8418b805b3b4b7d25b4d4
def find_top_student():
n = int(input().strip())
top_student = None
max_score = -1
for _ in range(n):
line = input().strip().split()
name = line[0]
scores = list(map(int,line[1:4]))
total_scores = sum(scores)
if total_scores > max_score:
max_score = total_scores
top_student = (name,scores)
print(f"{top_student[0]} {' '.join(map(str,top_student[1]))}")
if __name__ == "__main__":
find_top_student()