运行以下C++代码,最终的输出结果是?
#include <iostream>
using namespace std;
int main() {
int arr[3][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};
int res = 0;
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 4; j++) {
if(i % 2 == 0 && j % 2 == 1) {
res += arr[i][j];
}
}
}
cout << res << endl;
return 0;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析