文章
310
粉丝
0
获赞
123
访问
19.5k
//题目有问题,只要Case就可以啦
nom=1
while(1):
try:
ss = list(map(int, input().split()))
n = ss[0]
c = ss[1]
s = []
if n==0:
quit()
for i in range(n):
sm = list(map(str, input().split()))
xuehao = sm[0]
name = sm[1]
score = int(sm[2])
s.append([xuehao, name, score])
if c == 1:
out = sorted(s, key=lambda x: x[0])
if c == 2:
out = sorted(s, key=lambda x: (x[1],x[0]))
if c == 3:
out = sorted(s, key=lambda x: (x[2],x[0]))
# print("Case:%d"%nom)
print("Case:")
nom+=1
for i in out:
print(i[0], end=' ')
print(i[1], end=' ')
print(i[2])
except:
break
登录后发布评论
暂无评论,来抢沙发