1条回答 默认 最新
关注#!/usr/bin/python # -*- coding: UTF-8 -*- """ @author: Roc-xb """ if __name__ == '__main__': N = int(input("请输入班级个数:\n")) res = [] for i in range(N): line = list(map(int, input().replace("\n", "").split())) # 人数 count = len(line) # 最高分 max_score = max(line) # 最低分 min_score = min(line) # 平均分 avg_score = sum(line) / count line_res = "{} {} {} {}".format(count, max_score, min_score, round(avg_score, 1)) res.append(line_res) for line in res: print(line)输入参数:
3
81 80 55 90 82 95 95 45
82 90 77 66 50 98
83 60 98 56 89 90 91 94 95
本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用