网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
【单选题】若有以下程序段: int r=8;r>>1; r的值
A.16
B.8
C.4
D.2
参考答案和解析
循环体语句一次也不执行
更多 “【单选题】若有以下程序段: int r=8;r>>1; r的值A.16B.8C.4D.2” 相关考题
考题
有以下程序void f(int n, int *r){ int r1=0;if(n%3==0) r1=n/3;else if(n%5==0) r1=n/5;else f(--n,r1);*r=r1;}main( ){ int m=7,r;f(m,r); printf("%d\n",r);}程序运行后的输出结果是A) 2B) 1C)3D) 0
考题
( 20 )有如下程序段int i =0, j=1;int & r=i ; // ①r =j; // ②int*p= & i ; // ③*p= & r ; // ④基中会产生编译错误的语句是A ) ④B ) ③C ) ②D ) ①
考题
下面程序的输出结果是()。include f(int b[],int n){ int i,r;r = 1;for(i=0;i
下面程序的输出结果是( )。 include <stcdio.h> f(int b[],int n) { int i,r; r = 1; for(i=0;i<=n;i++) r=r*b[i]; return r; } main() { int x,a[]={2,3,4,5,6,7,8,9}; x=f(a,3); printf("%d\n",x); }A.720B.120C.24D.6
考题
以下程序的执行结果是【】。 include int f(int b[],int n) { int i,r=1; for(i=0;i
以下程序的执行结果是【 】。include<iostream.h>int f(int b[],int n){int i,r=1;for(i=0;i<n;i++)r=r*b[i];return r;}void main(){int x,a[]={2,3,4,5,6,7,8,9};x=f(a,3);cout<<x<<endl;}
考题
若有以下程序段: include using namespace std; int main() {char*p="abcdefgh",*r;l
若有以下程序段:include <iostream>using namespace std;int main(){char*p="abcdefgh",*r;long*q;q=(long*)p;q++;r=(char*)q;cout<<r<<end1;return 0;}该程序的输出结果是【 】。
考题
若有如下程序:include using namespace std;int main(){ char *p="abcdefgh",*r; lon
若有如下程序: #include <iostream> using namespace std; int main() { char *p="abcdefgh",*r; long *q; q=(long *)p; q++; r=(char *)q; cout<<r<<end1; return 0; } 上述程序的输出结果是( )。A.abcdefghB.0C.abcdD.efgh
考题
有以下程序:includeusing namespace std;{public:TestClass(int r1,int r2){R1=r1;R2
有以下程序: #include<iostream> using namespace std; { public: TestClass(int r1,int r2) { R1=r1; R2=r2; } void print(); void print() const; private; int R1,R2; }; void TestClass::print() { cout<<R1<<","<<R2<<end1; } void Testclass::print() const cout<<R1<<","<<R2<<end1; } int main() { TestClass a(5,4); const TestClass b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.20,52C.0,0D.4,5
考题
有以下程序:includeusing namespace std;class R{ public: R(int r1,int r2) {R1=r1;
有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print()const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<end1; } void R::print()const { cout<<R1<<","<<R2<<end1; } int main() { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.4,5C.20,52D.52,20
考题
若有程序 fun(int a,int b) { static int c=0 c+=a+b; retum c; } main () { int x=5,y=3,z=7,r; r=fun((y,x+y),z); r=fun(x,y); printf("%d\n",r); } 上面程序的输出结果______。A.23B.15C.19D.18
考题
有以下程序includestdio.hint*f(int*p,int*q);main( ){int m=1,n=2,*r=m;r=f(r,stdio.hint*f(int*p,int*q);main( ){int m=1,n=2,*r=m;r=f(r,n);printf(”%d\n”,*r);}int-f(int*P,int*q)(return(*p*q)?p:q;)程序运行后的输出结果是______。
考题
若有如下程序段: include using namespace std; int main() {char*p="abcdefgh",*r;l
若有如下程序段:include <iostream>using namespace std;int main(){char *p="abcdefgh",*r;long *q;q=(long *)p;q++;r=(char *)q;cout<<r<<end1;return 0;}该程序的输出结果是______。
考题
若有以下程序段: int r=8; print("%d\n",r1): 输出结果是( )。 A.16B.8S
若有以下程序段: int r=8; print("%d\n",r1): 输出结果是( )。A.16B.8C.4D.2
考题
有以下程序:includeusing namespace std;class R{public:R(int r1,int r2){R1=rl;R2=
有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=rl; R2=r2; } void print(); void print()const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<end1; } void R::print() const { cot<<R1<<","<<R2<<end1; } int main() { Ra(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
考题
下列程序的执行结果是( )。includeint fun(int b[],int n){ int i,r=1;for(i=0;i
下列程序的执行结果是( )。 #include<iostream.h> int fun(int b[],int n) { int i,r=1; for(i=0;i<n;i++) r=r*b[i]; return r; } void main() { int x,a[]={1,2,3,4,5,6,7,8}; x=fun(a,3); cout<<x<<end1; }A.5B.6C.7D.8
考题
有以下程序:includeusing namespace std;class R{public:R(int r1,int r2){R1=r1;R2=
有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print0const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<endl; } void R::print() const { cout<<Rl<<","<<R2<<endl; } int main() { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是( )。A.5,4B.20,52C.0,0D.4,5
考题
有以下程序: void f(int n,int * r) {int r1=0; if(n%3==0)r1=n/3; else if(n%5==0)r1=n/5; else f(--n,r1); *r=r1;} main() {intm=7,r; f(m,r);printf("%d\n",r);} 程序运行后的输出结果是______。A.2B.1C.3D.0
考题
有以下程序;include using namespace std;class R{public:R(int r1,int r2){R1=r1;R2
有以下程序; #include <iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print () const; private: int R1, R2; }; void R::print () { cout<<R1<<","<<R2<<endl; } void R::print() const { cout<<R1<<", "<<R2<<endl; } int main () { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
考题
有以下程序:include using namespace std;class R{public: R(int f1,int r2) {R1=r1;
有以下程序: #include <iostream> using namespace std; class R { public: R(int f1,int r2) { R1=r1; R2=r2; } void print(); void print ()const; private: int R1, R2; }; void R: :print() { cout<<R1<<", "<<R2<<end1; } void R: :print() const { cout<<Rl<<", "<<R2<<end1; } int main () { R a(5,4); const R b(20,52); b.print (); return 0; } 执行后的输出结果是A.5,4B.20,52C.0,0D.4,5
考题
若有以下程序:include using namespace std;define PI 3.14class Point{private: in
若有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; } int gety() { return y; } }; class Circle : public Point { private: int r; public: Circle(int a, int b,int c) :Point(a,b) { r=c; } int getr() { return r; } double area() { return PI*r*r; } }; int main() { Circle c1(5,7,10); cout<<c1.area()<<end1; return 0; } 程序执行后的输出结果是( )。A.314B.157C.78.5D.153.86
考题
以下程序的执行结果是()。includeint fun(int b[],int n){int i,r=1;for(i=0;i
以下程序的执行结果是( )。 #include<iostream.h> int fun(int b[],int n) { int i,r=1; for(i=0;i<n;i++) r=r*b[i]; } void main() { int x,a[]={1,2,3,4,5,6,7,8}; x=fun(a,3); cout<<x<<endl; }A.5B.6C.7D.8
考题
听力原文:[解析] 有以下程序:includeusing namespace Std;Class R{public:R(int r1,i
听力原文:[解析]有以下程序: #include<iostream> using namespace Std; Class R {public: R(int r1,int r2) {R1=r1; R2=r2;} void print(); void print()const; private: int R1,R2;}; roid R::print() {cout<<R1<<“,”<<R2<<endl;} void R::print()conA.5,4B.20,52C.0,0D.4,5
考题
读程序:includef(int b[],int n){ int i,r;r=1;for(i=0;i
读程序: #include <stdio.h> f(int b[],int n) { int i,r; r=1; for(i=0;i<=n;i++) r=r*b[i]; return r; } main() { int x,a[]={2,3,4,5,6,7,8,9}; x=f(a,3); printf("%d\n",x); } 上面程序的输出结果是( )。A.720B.120C.24D.6
考题
有以下程序 include using namespace std; class R{ public: R(int r1,int r2){R1=r
有以下程序#include <iostream>using namespace std;class R{public:R(int r1,int r2){R1=r1;R2=r2;}void print();void print()const;private:iht R1,R2;};A.5,4B.20,52C.0,0D.4,5
考题
若有以下程序:include using namespace std;define PI 3.14class Point {private: i
若有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int B) { x=a; y=b; } int getx() { return x; } int gety() { reurn y; } }; class Circle: public Point { private: int r; public: Circle(int a,int b.int C) :Point(a,B) r=c; int getr() { return r; } double area() { return PI*r*r; } }; int main() { Circle cl(5,7,10); cout<<c 1 .area()<<end1; return 0; } 程序执行后的输出结果是A.314B.157C.78.5D.153.86
考题
以下程序的执行结果是______ include int f(int b[],int n) { int i,r=l; for(i=0;
以下程序的执行结果是______include<iostrearn.h>int f(int b[],int n){int i,r=l;for(i=0;i<n;i++)r=r*b[i];return r;}void main(){int x,a[]= {2,3,4,5,6,7,8,9};x=f(a,3):cout<<x<<endl;}
考题
单选题若有以下程序段:int r=8;printf(%d,r1);输出结果是( )。A
16B
8C
4D
2
热门标签
最新试卷