‹ 上一题 下一题 ›

g4-04056. GESP-4级-2025-12-单选-第08题 未做

运行如下代码会输出( )。

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;
}
  • A.
  • B.
  • C.
  • D.
未选择
输入
输出

            
答案