解题思路:
注意事项:
参考代码:
def compare_students(student):
name, age, score = student
return (score, name, age) # 按成绩、姓名、年龄的顺序进行排序
while True:
try:
n = int(input()) # 学生数量
students = []
for _ in range(n):
name, age, score = input().split()
students.append((name, int(age), int(score)))
sorted_students = sorted(students, key=compare_students)
for student in sorted_students:
name, age, score = student
print(name, age, score)
except EOFError:
break
0.0分
1 人评分
母牛的故事 (C语言代码)浏览:1428 |
DNA (C语言代码)浏览:540 |
川哥的吩咐 (C语言代码)浏览:611 |
C语言程序设计教程(第三版)课后习题12.6 (C语言代码)浏览:662 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:534 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:667 |
A+B for Input-Output Practice (III) (C语言代码)浏览:424 |
买不到的数目 (C语言代码)浏览:3094 |
小O的数字 (C++代码)浏览:763 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:540 |