题解 | 最厉害的学生

最厉害的学生

https://www.nowcoder.com/practice/b6e7a9ca04d8418b805b3b4b7d25b4d4

def find_top_student():
    n = int(input().strip())
    top_student = None
    max_score = -1

    for _ in range(n):
        line = input().strip().split()
        name = line[0]
        scores = list(map(int,line[1:4]))
        total_scores = sum(scores)

        if total_scores > max_score:
            max_score = total_scores
            top_student = (name,scores)
    print(f"{top_student[0]} {' '.join(map(str,top_student[1]))}")


if __name__ == "__main__":
    find_top_student()

全部评论

相关推荐

2025-12-02 19:33
辽宁科技大学 golang
Richard奇:还得是有鹅选鹅
投递腾讯等公司9个岗位
点赞 评论 收藏
分享
2025-12-31 18:42
复旦大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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