单项选择题
有如下程序:
#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()Derived d;return 0;)
执行上面的程序将输出( )。
A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include<iostream> using namespace std; class BASE public: ~BASE()cout<< BASE ;) ; class DERIVED:public BASE public: ~DERIVED()cout<< DERIVED ; ; int main()DERIVED x;return 0; 执行后的输出结果是( )。
A.BASE
B.DERIVED
C.BASEDERIVED
D.DERIVEDBASE
点击查看答案&解析
单项选择题
下列程序的输出结果是( )。 #include<iostream.h> void main() char *str= 12123434 ; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’ 0’;i++) switch(str[i]) case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:x1++; cout<<x1<< , <<x2<< , <<x3<< , <<x4;
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6,4,2
点击查看答案&解析
相关试题
下列程序将x、y和z按从小到大的顺序排列,...
operator是运算符重载时必须使用的关键字,...
下列程序完成从文件读取、文件显示的同时写...
在下面横线上填写适当的语句,完成程序。 ...
请在下列程序中的横线处填写正确的语句。 ...