题目
有如下程序: #include<iostream) using namespace std; classBase{ public: Base(int x=0){cout<<x;} }; Class Derived:public Base{ public: Derived(int x=0){cout<<x;} private: Base Val; }; int main(){ Derived d(1); return
A.100
B.000
C.010
D.001
第3题
有如下程序 #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)
第4题
有如下程序: #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***
第5题
有如下程序: #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***
第6题
有如下程序:#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***
第7题
有如下程序:#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
第8题
有如下程序:
#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
第9题
有如下程序: #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
第10题
?有如下程序:
include(iostream.h>
include<stdlib.h>
classTestClass
{
public:
intX,y;
TestClass(){x=y=0;}
TestClass(inta,intb){x=a;y=b;}
voiddisp()
{
cout<<"x="<<x<<",y="<y<<endl;
}
};
voidmain()
{
TestClasss1(2,3);
s1.disp();
}
程序执行后的输出结果是()。
A.100
B.000
C.010
D.001
第11题
有如下程序: #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
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!