单项选择题

有如下程序: #include <iostream.h> using namespace std; class Base { public: Base(){cout<<"BB"; f(); void f(){cout <<"Bf";} }; class Derived: public Base { public: Derived(){cout<<"DD";} void f(){cout<<"Df";} }; int main(){Dcrivcd d; return 0;} 执行上面的程序将输出( )。

A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include <iostream.h> using namespace std; class Stack { public: Stack(unsigned n=10):size(n){rep_=new int [size]; top=0;} Stack(Stack&s): size (s.size) { rep_=new int[size]; for(int i=0;i<size;i++) rep_[i]=s.rep_[i]; top=s.top; } ~Stack(){delete[]rep_;} void push(int a){rep_[top]=a; top++;} int pop(){--top; return rep_[top];} bool isEmpty() const {return top ==0;} private: int*rep_; unsigned size, top; }; int main() { Stack s1; for(int i=1;i<5;i++) sl.push(i); Stack s2(s1); for (int i=1;i<3;i++) cout<<s2.pop()<<’,’; s2.push(6); s1.push(7); while(!s2.isEmpty()) cout<<s2.pop()<<’,’; return 0; } 执行上面程序将输出( )。
A.4,3,2,1,
B.4,3,6,7,2,1,
C.4,3,6,2,1,
D.1,2,3,4,
填空题
在结构化设计方法中,数据流图表达了问题中的数据流与加工间的关系,并且每一个______实际上对应一个处理模块。
相关试题
  • 请将下列栈类Stack补充完整。class Stack...
  • 已知类sample是一个抽象类,其成员函数disp...
  • 若要访问指针变量p所指向的数据,应使用表...
  • 请将下列程序补充完整,使得输出结果为bbaa...
  • 在面向对象的程序设计中,将数据和处理数据...