有如下程序: #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***
第1题
有如下程序: #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***
第2题
有如下程序: #include <iostream> using namespace std; Class x { protected: int a; public: x() { a=1; } }; class x1 : virtual public x { public: x1() { a+=1; cout<<
A.1
B.123
C.242
D.244
第3题
有如下程序: #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
第4题
有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(5); cout<<scientific<<315926535<<endl; retrun 0; } 程序运行后,输出的结果是()。
A.3.14E+02
B.3.14E+02
C.**3.14e+002
D.314.16
第5题
有如下程序: #include <iostream> using namespace std; using namespace std; class Base{ public: void fun(){cout<<"Base::fun"<<endl:} }; class Derived:public Base{ public: void fun(){ eout<<"Derived::fun"<<endl: } }; int main(){ Derived d; d.fun(); return 0; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下画线处应填入的语句是
A.Base.fun();
B.Base::fun();
C.Base->fun();
D.fun();
第6题
有如下程序:#include <iostream> using namespace std; class Test{ public: Test(){} ~Test(){cout<<’#’;} }; int main(){ test temp[2], *ptemp[2]; return 0; } 执行这个程序输出星号(#)的个数为()。> A、1
B、2
C、3
D、4
第7题
有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(5); cout<<scientific<<315926535<<end1; return 0; } 程序运行后,输出的结果是
A.3.14E+02
B.3.14E+02
C.**3.14e+002
D.314.16
第8题
有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<888<<end1; return 0; } 的执行结果是()。
A.###888
B.888###
C. ***888
D.888***
第9题
有如下程序: #include(iostream) using namespace std; class TestClass{ protected: TestClass(){couti(cout<<‘x’;} TestClass(char c){cout<<c;}}; class TestClassl:publicTestClass{ public: TestClassl(char c){cout<<c;}}; int main(){ Te
A.y
B.yx
C.xy
D.yy
第10题
有如下程序: #include<iostream> using namespace std; classA{ public: virtua1 voidfunc1(){cout<<“A1”;} voidfunc2(){cout<<“A2”;}}; class B:publicA{ public: void funcl(){cout<<“B1”;} void func2(){cout<<“B2”;}}; intmain(){ A*p=ne
A.B1B2
B.A1A2
C.B1A2
D.A1B2
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!