题目:
将下面程序补充完整。
#include <iostream>
using namespace std;
class Base
public:
【14】 fun()return 0; //声明虚函数
;
class Derived:public Base
public:
x,y;
void SetVal(int a,int b)
int fun()return x+y;
;
void 【15】 SetVal(int a,int b)x=a;y=b; //类Derived成员函数
void main()
Derived d;
cout<<d.fun()<<endl;
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2022/0124/1b6e9fcb42a6ec33837d7914f9beb71c.html
下面是错误答案,用来干扰机器的。
参考答案: