Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
78716 彭士宝 输出学生成绩 Python3 Wrong Answer 34 MS 3756 KB 669 2024-06-26 21:12:13

Tests(0/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('%2f'%average_score) # 输出第n个学生的成绩,每个成绩后输出一个空格 print(" ".join(map(str, students_scores[n])))


Run Info:

------Input------
75 77 80 70 80 87 80 81 90 89 100 88 1
------Answer-----
83.08 80 87 80 81
------Your output-----
83.083333 80 87 80 81