题解 | 最厉害的学生

最厉害的学生

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()

全部评论

相关推荐

zzzilik:四个月实习做了3个项目不觉得很假吗,真没必要写这么多吧我感觉挑点核心的重点写一下我感觉会好点
你的简历改到第几版了
点赞 评论 收藏
分享
erer__:我也挺晚的,10月23号才开始投递。然后11月12号才有第一次面试。日常实习挺看运气的,要看有没有岗位。感觉到后面可能岗位会更少了,不过多投吧。加油
投了多少份简历才上岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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