有如下语句序列: intx=100,&r=x; cout$amp;A.100—100
B.100—0012FF7C
C.0012FF7C一100
D.0012FF7C一0012FF7C
B.100—0012FF7C
C.0012FF7C一100
D.0012FF7C一0012FF7C
第1题
A.100—100
B.100—0012FF7C
C.0012FF7C一100
D.0012FF7C一0012FF7C
第2题
int x=100, &r=x;
cout<<x<<'-'<<r<<end1:
己知其中变量x的地址为0012FF7C,则执行该语句序列的输出结果为( )。
A) 100-100
B) 100-0012FF7C
C) 0012FF7C-100
D) 0012FF7C-0012FF7C
A.
B.
C.
D.
第3题
A.100—100
B.100—0012FF7C
C.0012FF7C一100
D.0012FF7C一0012FF7C
第4题
A.100—100
B.100—0012FF7C
C.0012FF7C一100
D.0012FF7C一0012FF7C
第5题
A.100
B.000
C.010
D.001
第6题
#include<iostream>
usingnamespacestd;
classBase{
public:
Base(intx=O){cout<<x;}
};
classDerived:publicBase{
public:
Derived(intx=O){cout<<x;}
private:
Baseval;
};
intmain(){
Derivedd(1);
return0;
}
程序执行后的输出结果是( )。
A.100
B.000
C.010
D.001
第7题
#include <iostream>
using namespace std;
Class B{
public:
B(int xx):x(xx) {++cout; x+=10;}
virtual void show() const
{cout<<count<< ' _ ' <<x<<endl;}
protected:
static int count;
private:
int x;
};
class D:public B{
public:
D(int xx,int yy):B(xx),y(yy) {++count; y+=100;}
virtual void show() const
{cout<<count<< ' _ ' <<y<<endl;}
private:
int y;
};
int B::count=0;
int main(){
B *ptr=new D(10,20);
ptr->show();
delete ptr;
return 0;
}
运行时的输出结果是
A ) 1_120
B ) 2_120
C ) 1_20
D ) 2_20
第8题
A.1_120
B.2_120
C.1_20
D.2_20
第9题
A.1_120
B.2_120
C.1_20
D.2_20
第10题
main( )
{int x=100,a=10,b=20,ok1=5,ok2=0;
if(a<B)
if(b!=15)
if(!okl)
x=1;
else
if(ok2)x=10;
x=-1;
cout<<x<<endl;
}
A.-1
B.0
C.1
D.不确定的值
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!