填空题

如下程序执行后的输出结果是 【14】 。 #include <iostream> using namespace std; class Base { public: Base(int x,int y) { a=x; b=y; } void Show() { cout<<"Base: "<<a<< ’,’ <<b<<" "; } private: int a,b; }; class Derived : public Base { public: Derived(int x, int y, int z) : Base(x,y),c(z) { } void Show() { cout<<"Derived:"<<c<<end1; } private: int c; }; int main() { Base b(100,100),*pb; Derived d(10,20,30); pb=&b; pb->Show(); pb=&d; pb->Show(); return 0; }

答案: Base:A00,A00 Base:A0,B0
题目列表

你可能感兴趣的试题

填空题

对待排序文件的初始状态作要求的排序方法是 【1】

答案: 归并排序
填空题

软件工程的3个要素是工具、过程和 【3】

答案: 方法
填空题

Jackson方法是一种面向 【2】 的结构化方法。

答案: 数据结构
微信扫码免费搜题