/* 参数个数不同的重载函数列子 time:20200415 where:gfdx */ #include<iostream> using namespace std; int mul(int x, int y) { return x* y; } int mul(int a, int b, int c) { return a * b * c; } int main() { int i = 1; int j = 3; int h = 5; cout << "x*y is " << mul(i, j) << endl;//输出的重载1 cout << "a*b*c is " << mul(i, j, h) << endl;//输出重载2 return 0; }