#3223. [GESP202509 四级 C++] 第 5 题

[GESP202509 四级 C++] 第 5 题

下面这段代码会输出( )。

int x = 5;

void foo() {
    int x = 10;
    cout << x << " ";
}

void bar() {
    cout << x << " ";
}

int main() {
    foo();
    bar();
}

{{ select(1) }}

  • 5 5
  • 10 10
  • 5 10
  • 10 5