测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A21982. 运⾏如下代码会输出( )。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; …

单选题 较难

题目描述

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

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;
}

选项(单选)

上一题 下一题