black

登录

单项选择题

有如下程序:
ClassBase{
public:
intdata;
};
ClassDerived1:publicBase{};
ClassDerived2:protectedBase{};
intmain(){
Derived1d1;
Derived2d2;
d1.data=0;//①
d2.data=0;//②
return0;
}
下列关于程序编译结果的描述中,正确的是(  )。

A.①②皆无编译错误
B.①有编译错误,②无编译错误
C.①无编译错误,②有编译错误
D.①②皆有编译错误
相关考题

判断题 ( )透水性大的饱和无黏性土(包括碎石类土和砂类土),其固结过程在短时间内就可以结束,固结稳定所经历的时间很短,认为存外荷施加完毕时,其固结已基本完成,因此,一般不考虑无黏性土的固结问题。

单项选择题 有如下程序: #include<iostream> usingnamespacestd; classPoint{ intX,Y; public point(intx1=0,inty1=O)tx(x1),y(y1){} intget(){returnx+y;} }; classCircle{ pointcenter; intradius; public circle(intCX,intcy,intr):center(cx,cy),radius(r) {} intget(){returncenter.get()+radius;) }; intmain(){ circlec(3,4,5); cout<<c.get()<<endl; return0; } 运行时的输出结果是(  )。

单项选择题 有如下程序: #include<iostream> usingnamespacestd; intmain(){ intf,f1=0,f2=1 for(inti=3;i<=6;i++){ f=f1+f2: f1=f2:f2=f } cout<<f<<endl; return0; } 运行时的输出结果是()。

All Rights Reserved 版权所有©在线考试题库网(zxkao.com)

备案号:湘ICP备14005140号-7

经营许可证号:湘B2-20140064