第38585题 判断题
下面程序可以正确计算并输出 3 名学生的平均成绩。
/ 10
struct Student {
int id;
int score;
};

int main() {
Student students[3] = {
{1, 90},
{2, 80},
{3, 100}
};

int sum = 0;
for (int i = 0; i < 3; i++) {
sum += students[i].score;
}
double average = sum / 3.0;
cout << average << endl;
return 0;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析