下面代码可以正常编译并输出 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;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析