def find_top_student(scores):
    max_score = 0
    top_student = ""
    for student, score in scores.items():
        total_score = sum(score)
        if total_score > max_score:
            max_score = total_score
            top_student = student
    return top_student

def find_min_max_score(scores):
    all_scores = []
    for score in scores.values():
        all_scores.extend(score)
    min_score = min(all_scores)
    max_score = max(all_scores)
    return min_score, max_score

N = int(input())
scores = {}
for _ in range(N):
    student = input().split()
    name = student[0]
    student_scores = list(map(int, student[1:]))
    scores[name] = student_scores

for student, score in scores.items():
    total_score = sum(score)
    print(total_score)

top_student = find_top_student(scores)
print(top_student)

min_score, max_score = find_min_max_score(scores)
print(f"{max_score} {min_score}")
``
题目描述小明同学所在的班级共有N名同学期末考试时进行了数学、语文、英语、 地理四门功课的测试。现要将班里总分最高的同学评为学习小状元。请同学们帮助计算:1每位同学的总分是多少?2找出总分最高的那位同学。3找出所有成绩中最高的分数和最小的分数。输入描述第一行:有一个整数N表示有N名同学已知1≤N≤30 。后N行:每两行代表一个人的信息记录:包括学生的姓名及4门功课的分数:其中分数为整数每个分数互不相

原文地址: https://www.cveoy.top/t/topic/hWp6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录