第29733题 单选题
已知C++中存储的一维数组arr元素为[3,1,4,2,5],若采用前缀和数组计算下标从1开始的区间[2,4]的元素和,下列计算式正确的是?

前缀和数组s的构造规则为:s[0] = 0,s[i]表示原数组前i个元素的累加和,即s[i] = arr[1] + arr[2] + ... + arr[i]。

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析