#GESP1739. [GESP]L3-202306-Q1739-S

[GESP]L3-202306-Q1739-S

在下列代码的横线处填写( ),可以使得输出不是 “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;
}

{{ select(1) }}

  • res = res + array[i]
  • res = res & array[i]
  • res = res | array[i]
  • res = res ^ array[i]