1004 成绩排名

n = int(input())
# 用来存所有的学生信息
stu_infos = []
min_score = 101
max_score = 0
min_number = -1
max_number = -1
for i in range(n):
    # 依次输入每个学生的信息
    student_info = input()
    # 将输入的学生信息按空格进行分割并加入到列表中
    stu_infos.append(student_info.split(' '))
for i in range(n):
    num = int(stu_infos[i][2])
    if num > max_score:
        max_score = num
        max_number = i
    if num < min_score:
        min_score = num
        min_number = i
print(stu_infos[max_number][0] + " " + stu_infos[max_number][1])
print(stu_infos[min_number][0] + " " + stu_infos[min_number][1], end="")

上一篇:PAT乙级-1004 成绩排名


下一篇:zzulioj:1004: 三位数的数位分离