以下是使用 Python 实现的代码: ```python # 定义学生成绩数组 student_scores = [72, 89, 65, 58, 87, 91, 53, 82, 71, 93, 76, 68] # 初始化成绩等级人数数组 count = [0] * 5 # 遍历学生成绩,统计各等级人数 for score in student_scores: if score < 60: count[0] += 1 # E 级 elif score >= 60 and score < 70: count[1] += 1 # D 级 elif score >= 70 and score < 80: count[2] += 1 # C 级 elif score >= 80 and score < 90: count[3] += 1 # B 级 else: count[4] += 1 # A 级 print(count) ``` 额外需要注意的逻辑点: 1. 边界值的判断要准确,确保分数的分类没有遗漏或错误。 2. 如果学生人数较多,考虑使用更高效的数据结构和算法来提高性能。 3. 代码中的条件判断可以进一步优化,例如使用更简洁的表达式。 [2025-03-24 16:28:43 | AI写代码神器 | 307点数解答]