题库 / 3041208. 读代码:cout 输出(2025-12)
3041208. 读代码:cout 输出(2025-12)
题目描述
运行如下代码会输出()。
struct Point {
int x, y;
};
struct Rectangle {
Point topLeft;
Point bottomRight;
};
int main() {
Rectangle rect = {{10, 10}, {20, 20}};
rect.topLeft.x = 5;
Point* p = &rect.bottomRight;
p->y = 5;
cout << rect.topLeft.x + rect.bottomRight.y;
return 0;
}
作答说明
单选题:在选项里选出唯一正确的一项,提交后立即判定。答对得满分,答错可以重新提交(两次提交之间需要间隔 20 秒)。
题目来源
CCF GESP 2025 年 12 月认证 C++ 4 级试题,第 8 题。