网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
有如下语句序列: int x=100,&r=x;cout<
A

100-100

B

100-0012FF7C

C

0012FF7C-100

D

0012FF7C-0012FF7C


参考答案

参考解析
解析:
在语句“int x=100,&r=x;”中,声明r初始化对x的引用,所以x和r的值都是100。
更多 “单选题有如下语句序列: int x=100,r=x;cout A 100-100B 100-0012FF7CC 0012FF7C-100D 0012FF7C-0012FF7C” 相关考题
考题 执行下列语句后,输出的结果为______。void run(){static int x=3;x++;cout<<x<<" ";}int main(){for(int i=0;i<2;i++)fun();return D;}

考题 有如下语句序列; int k=0; do{k+=5;couk0)cout 有如下语句序列; int k=0; do{k+=5;couk<<'$';) while(k<19); while(k-->0)cout<<'*'; 执行上面的语句序列输出字符$和。的个数分别是A.4和20B.5和20C.4和21D.5和21

考题 如下程序的输出结果是______。 include using namespace std; int funl(int x){retu 如下程序的输出结果是______。include<iostream>using namespace std;int funl(int x){return++x;}int fun2(int&x){return++x;}int main( ){int x:1,y=2;Y=funl(fun2(x));cout<<x<<','<<y;return 0;}

考题 有如下程序: include using namespace std; class Part{ public: 有如下程序: #include <iostream> using namespace std; class Part{ public: Part(int x=0):val(x) { cout<<val; } ~Part() { cout<<val; } private: int val; }; class Whole { public: Whole(int x, int y, int z=0):p2(x),p1 (y),val(z) { cout<<val; } ~whole() { cout<<val; private: Part p1,p2; int val; }; int main() { Whole obj (1,2,3); return 0; }程序的输出结果是A.123321B.213312C.213D.123123

考题 有如下语句序列:int k=0:d0{k+=5;cout0)cout 有如下语句序列: int k=0: d0{k+=5;cout<<‘$’;} while(k<19); while(k-->0)cout<<‘*’; 执行上面:的语句序列输出字符“$”和“*”的个数分别是( )。A.4和20B.5和20C.4和21D.5和21

考题 执行下列语句段后程序的输出结果是______。int x[]={1,2,3,4,5};int q=x;cout*(++q)<<end1;

考题 有如下语句序列:int k=0:do{k+=5;cout0)cout 有如下语句序列: int k=0: do{k+=5;cout<<'$';} while(k<19); while(k-->0)cout<<'*'; 执行上面的语句序列输出字符“$”和“*”的个数分别是( )。A.4和20B.5和20C.4和21D.5和21

考题 以下程序执行后的输出结果是( )。include usingnamespacestd;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #include <iostream> using namespace std; void try(int,int,int,int); int main ( ) { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = X*X; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 有如下语句序列: intx=100,&r=x; coutx一rendl; 已知其中变量x的地址为0012FF2C,则执行该语句序列的输出结果为( )。A.100—100B.100—0012FF7CC.0012FF7C一100D.0012FF7C一0012FF7C

考题 若有如下语句includevoid main(){ int x=3: do{ X=X-2; cout 若有如下语句 #include<iostream.h> void main() { int x=3: do{ X=X-2; cout<<X; }while(!(--x)); } 则上面程序段A.输出的是1B.输出的是1和-2C.输出的是3和0D.是死循环

考题 执行下列语句:includeusing namespace std;int main(){int x=3;if(x=5)cout 执行下列语句: #include<iostream> using namespace std; int main() { int x=3; if(x=5) cout<<x++<<end1; else cout<<x<<end1; return 0; } 程序的输出是( )。A.3B.4C.5D.6

考题 有如下程序:includeusing namespace std;class Part{public:Part(int x=0):val(x){co 有如下程序: #include<iostream> using namespace std; class Part{ public: Part(int x=0):val(x){cout ~Part( ){cout<<val;} pritave: int val; }; class Whole{ public: Whole(int x,int Y,int z=0):p2(x),p1(Y),val(z){cout<<val;} ~Whole( ){cout<<val;} pritave: Part p1,p2; int val; f; int main( ){ Whole obj(1,2,3); return 0; } 程序的输出结果是A.123321B.213312C.213D.123123

考题 有如下程序:includeusing namespace std;class Base{public:Base(int x=0){cout 有如下程序: #include<iostream> using namespace std; class Base{ 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 0; } 程序的输出结果是A.0B.1C.01D.001

考题 有如下程序:includeusing namespace std;int fun(int a, int b){return(++a*b++);}vo 有如下程序: #include<iostream> using namespace std; int fun(int a, int b) {return(++a*b++);} void main() { int x=3,y=4,z=5,r; r=fun (fun (x,y),z); cout<<r>>endl; cout<<x<<endl; cout<<y<<endl; } 该程序的输出的结果是( )。A.85 3 4B.60 3 4C.126 4 5D.85 4 5

考题 有如下程序:includeint func(int a, int b){return(a+b) ;}void main( ){int x=2,y 有如下程序: #include<iostream.h> int func(int a, int b) { return(a+b) ;} void main( ) { int x=2,y=5,z=8,r; r=func(func(x,y) ,z) ; cout < < r; } 该程序的输出的结果是A.12B.13C.14D.15

考题 设某程序中定义了全局整型变量x和r,且函数f()的定义如下所示,则在语句“x= r*r+1”中(49)。 int f(int r){ int x; X= r*r+1 ; return x; }A.x和r均是全局变量B.x是全局变量、r是形式参数C.x是局部变量、r是形式参数D.x是局部变量、r是全局变量

考题 有如下程序: include using namespace std; class Base{ int x; pu 有如下程序: #include<iostream> using namespace std; class Base{ int x; public: Base(int n=0):x(n){cout<<n;) int getX()const{return x;} }; class Derived:public Base{ int y; public: Derived(int m,int n):y(m,)Base(n){cout<<m;} Derived(int m):y(m){cout<<m;} }; int main(){ Derived d1(3),d2(5,7) return 0; }运行时的输出结果是A.375B.357C.375D.357

考题 若有如下语句 includevoid main(){int x=3;do{x=x-2cout 若有如下语句 #include<iostream.h> void main() { int x=3; do{ x=x-2 cout<<x; {while (! (- -x); } 则上面程序段( )A.输出的是1B.输出的是1和一2C.输出的是3和0D.是死循环

考题 有下列语句序列:int k=0;do{k+=5;cout0)cout 有下列语句序列: int k=0; do{k+=5;cout<<'$';} while(k<19); while(k-->0)cout<<'*'; 执行上面的语句序列输出字符“$”和“*”的个数分别是( )。A.4和20B.5和20C.4和21D.5和21

考题 执行语句: int result=100; cout= 60)(result 执行语句:int result=100;cout<<(((result>= 60)(result<=100))?"good":"general");结果是【 】。

考题 有如下语句序列:int x=-10;while(++x){}运行时while循环体的执行次数为______。

考题 如下程序执行后的输出结果是【】。include using namespace std; class Base { public: 如下程序执行后的输出结果是【 】。include <iostream>using namespace std;class Base{public:Base(int x,int y){a=x;b=y;}void Show(){cout<<"Base: "<<a<< ',' <<b<<" ";}private:int a,b;};class Derived : public Base{public:Derived(int x, int y, int z) : Base(x,y),c(z) { }void Show(){cout<<"Derived:"<<c<<end1;}private:int c;};int main(){Base b(100,100),*pb;Derived d(10,20,30);pb=b;pb->Show();pb=d;pb->Show();return 0;}

考题 以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 有如下程序: #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); returnA.100B.000C.010D.001

考题 有如下语句序列:int k=0;do { k+=5;cout 0)cout 有如下语句序列: int k=0; do { k+=5;cout <<'$;}while (k<19); while(k-- >0)cout<<'*';执行上面的语句序列输出字符$和*的个数分别是______ 。A.4和20B.5和20C.4和21D.5和21

考题 执行语句序列 int x=1,y=x; cout<<x<<'-'<<y<<endl; 输出结果为( )A.x-xB.1-1C.1-0D.异常

考题 以下程序执行后的输出结果是include.using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include<iostream>. using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定