题解 | #成绩排序#

成绩排序

http://www.nowcoder.com/practice/8e400fd9905747e4acc2aeed7240978b

import sys
while True:
    try:
        N = int(input())
        gz = input()
        L = []
        for i in range(N):
            L.append(input().split())
        if gz == "1":  
            L.sort(key = lambda x: int(x[1]))
        else:
            L.sort(key = lambda x: 100 - int(x[1]))

        for c in L:
            print(" ".join(c))
    except:
#         print(sys.exc_info())
        break



















全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 11:35
程序员小白条:话太多,没实力和学历,差不多回答回答就行了,身份地位不一样
点赞 评论 收藏
分享
评论
点赞
2
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务