#GESP3634. [GESP]L4-202512-Q3634-J

[GESP]L4-202512-Q3634-J

下面代码可以正常编译并输出 10。

#include <iostream>
using namespace std;

int calculate(int x, int y = 10);

int main() {
    cout << calculate(5);  // 调用1
    return 0;
}

int calculate(int x, int y) {
    return x * y;
}

int calculate(int x) {  // 重载函数
    return x * 2;
}

{{ select(1) }}

  • 正确
  • 错误