题目
有如下程序: #include <iostream> using namespace std: class A{ public: virtual void funcl(){cout<<"A1";} void func2(){cout<<"A2";} }; class B:public A{ public: void funcl(){cout<<"B1";} void fllnc2(){cout<<"B2";} }; int main(){ A*p=new B; p->funcl(); p->func2(); return 0: } 运行程序,屏幕上将显示输出
A.B182
B.A1A2
C.BlA2
D.AlB2
第1题
有如下程序: #include<iost earn> using namespace std; class TestClass{ protected: TestClass(){cout<<'x';} TestClass(char C) {cout<<c;} }; class TestClass1:public TestClass { public: TestClass1(char C) {Cout<<c;) }; int main(){ TestClass1 d1('y'); return 0; } 执行这个程序,屏幕上将显示输出()。
A.y
B.yx
C.xy
D.yy
第2题
若有以下程序: #include <iost ream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp () { cout<<a<<", "; } }; class B { private:
A.10,10,10
B.10,12,14
C.8,10,12
D.8,12,10
第5题
有如下程序 #include<iostream> #include<iomanip> using namespace std; int main(){ cout<<setprecision(3)<<fixed<<setfill('*')<<setw(8); cout<<12.345<<_______<<34.567; return 0; } 若程序的输出是: ** 12.345**34.567 则程序中下划线处遗漏的操作符是
A.setprecision(3)
B.fixed
C.setfill('*')
D.setw(8)
第6题
有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是
A.###123
B.123###
C.***123
D.123***
第7题
有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0; } 执行生的输出结果是()。
A. ###123
B.123###
C. ***123
D.123***
第8题
有如下程序:#include <iostream>#include<iomanip>using namespace std;int main(){ cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0;}执行后的输出结果是()。
A.###123
B.123###
C.***123
D.123***
第9题
有如下程序:#include <iostream>#include <iomanip>using namespace std;int main(){cout.fill('*');cout<<left<<setw(4)<<123<< "OK"<<end1;return 0;}执行这个程序的输出结果是()。
A.123*OK
B.123*OK**
C.*123OK
D.*123**OK
第10题
有如下程序:
#include<iomanip>
#include<iostream>
using namespace std;
int main(){
cout<<setfill('*')<<setw(6)<<123<<456;
return 0;
}
运行时的输出结果是()。
A) ***123***456
B) ***123456***
C) ***123456
D) 123456
第11题
有如下程序: #include <iostream> using namespace std; class AA { public: virtual void f() { cout<< "AA"; } }; class BB : public AA { public: BB() { cout << "BB"; } }; cla
A.AA
B.AABBCC
C.BBAABBCC
D.BBBBAACC
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!