第22447题
在给定的C++代码横线处选不能使输出为31的选项

在下列代码的横线处填写代码,可以使得输出不是"31"。

#include <iostream>
using namespace std;
int main() {
    int array[5] = {1, 2, 4, 8, 16};
    int res = 0;
    for (int i = 0; i < 5; i++)
        ____________; // 在此处填写代码
    cout << res << endl;
    return 0;
}
A

res = res + array[i]

B

res = res & array[i]

C

res = res | array[i]

D

res = res ^ array[i]

提交0次 正确率0.00%
答案解析