Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
78713 小徐老师 输出学生成绩 Python3 Accepted 35 MS 3764 KB 704 2024-06-26 21:08:28

Tests(1/1):


Code:

# 首先,我们定义一个列表来存储所有学生的成绩 students_scores = [] # 读取前三行输入,每行包含四个成绩 for _ in range(3): scores = list(map(int, input().split())) students_scores.append(scores) # 读取第四行输入,即需要输出成绩的学生编号n n = int(input()) # 计算总平均分数 total_scores = sum([sum(student_scores) for student_scores in students_scores]) average_score = total_scores / (3 * 4) # 输出总平均分数,保留两位小数 #print(f"{average_score:.2f}") print("%.2f" % average_score) # 输出第n个学生的成绩,每个成绩后输出一个空格 print(" ".join(map(str, students_scores[n])))