自考新教材-p59_4(1)

源程序:

#include <iostream>
using namespace std;
class A
{
public:
int fun(double);
int fun(int);
};
int A::fun(double x)
{
return (int)x / 2;
}

int A::fun(int x)
{
return x * 2;
}
int main()
{
A a;
int s = a.fun(6.0) + a.fun(2);
cout << s << endl;
system("pause");
return 1;
}

运行结果:

原文地址:https://www.cnblogs.com/duanqibo/p/12268534.html