EXY-TF-0960
第 41 题
下面代码可以通过编译。
int a[5];
a++;
语言:
C++
GESP真题
四级
2026.6
判断题号:
10
EXY-TF-0959
第 42 题
小杨想通过下面程序给饭卡充值,程序会输出 $70$。
void recharge(int money) {
money += 20;
}
int main() {
int card = 50;
recharge(card);
cout << card;
return 0;
}
语言:
C++
GESP真题
四级
2026.6
判断题号:
9
EXY-TF-0958
第 43 题
假设文件
output.txt 能正常打开,下面代码通过 rdbuf 将 cout 的输出重定向到了文件中。ofstream fout("output.txt");
streambuf* old_buf = cout.rdbuf();
cout.rdbuf(fout.rdbuf());
cout << "GESP Exam";
cout.rdbuf(old_buf);
语言:
C++
GESP真题
四级
2026.6
判断题号:
8
EXY-TF-0957
第 44 题
下面代码的时间复杂度是 $O(2^n)$。
int cnt = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
cnt++;
}
}
语言:
C++
GESP真题
四级
2026.6
判断题号:
7
EXY-TF-0956
第 45 题
在
C++ 中定义二维数组并初始化时,可以省略第一维,但不能省略第二维。因此 int a[][2] = {{1, 2}, {3, 4}}; 是合法的,而 int a[][] = {{1, 2}, {3, 4}}; 是不合法的。
语言:
C++
GESP真题
四级
2026.6
判断题号:
6
当前页显示 41 - 45
,共 840 道判断题