网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下程序段的功能是输出两个数据的最大数。 int x,y; cin>>x>>y; if(x>y) cout<<x<<endl;; else cout<<y<<endl;
参考答案和解析
1234
更多 “以下程序段的功能是输出两个数据的最大数。 int x,y; cin>>x>>y; if(x>y) cout<<x<<endl;; else cout<<y<<endl;” 相关考题
考题
阅读下面程序: include void f(int n) { int x(5); static int y(10); if(n>0) { ++
阅读下面程序:include<iostream.h>void f(int n){int x(5);static int y(10);if(n>0){++x;++y;cout<<x<<","<<y<<endl;}}void main(){int m(1);f(m),}则该程序的输出结果是【 】
考题
以下程序段的执行结果为()。includedefinePLUS(x,y)x+yvoid main (){int x=1,y=2,
以下程序段的执行结果为( )。 #include< iostream.h> #definePLUS(x,y) x+y void main () {int x=1,y=2,Z=3,sum: sum=PLUS (x+y,Z) * PLUS (y,Z): cout<<"SUM="<<sum; cout<<endl:}A.SUM=9B.SUM=12C.SUM=18D.SUM=30
考题
下列程序的执行结果是()。includeclass Sample{int x,y;public:Sample(){x=y=0;)Sam
下列程序的执行结果是( )。 #include<iostream.h> class Sample { int x,y; public: Sample(){x=y=0;) Sample(int a,int b){x=a;y=b;} ~Sample() { if=(x==y) cout<<“x=y”<<endl; else cout<<“x!=y”<<endl; } void disp() { coutA.x=2,y=2B.x=3,y=3C.x=2,y=3D.x=3,y=2
考题
使用VC6打开老考生文件夹下的工程test5_1,此工程包含一个源程序文件test5_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:x=3 y=5 z=08源程序文件test5_1.cpp清单如下:include<iostream.h>static int x=5;int z=0;int *add(int x,int y){cout<<"X="<<X<<"y="<<y<<" Z="<<z<<endl;z=z+x+y;/********found*********/return z;/********found*********/};void main(){int y=5;int x=3;/*********found********/cout<<(add(X,y))<<endl;}
考题
以下程序运行后的输出结果是【】。 include void fun(int x,int y) {x=x+y;y=x-y
以下程序运行后的输出结果是【 】。include<iostream.h>void fun(int x,int y){ x=x+y;y=x-y;x=x-y;cout<< x << "," <<y << " ,";}void main( ){ int x=2,y=3;fun(x,y);cout<< x << "," << y << endl;}
考题
以下程序的执行结果是______。 include void main() { int x=5 y=2; cout
以下程序的执行结果是______。include<iostream.h>void main(){int x=5 y=2;cout<<! (y==x/2)<<",";cout<<(y!=x%3)<<",";cout<<(x>0 y<0=<<",";cout<<(x!=y||x>=y)<<endl;}
考题
有如下程序:include void fun(int x, int y){int t=x;x=y;y=t;}int main (){int
有如下程序: #include <iostream> void fun(int x, int y){int t=x;x=y;y=t;} int main () { int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::endl; return 0; } 执行后的输出结果是A.42,42B.23,23C.23,42D.42,23
考题
有如下程序: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
考题
下列程序的输出结果是includeclass Myclass{public:Myclass(int i=0,int j=0){x=i;
下列程序的输出结果是 #include<iostream.h> class Myclass{ public:Myclass(int i=0,int j=0) { x=i; y=j; } void show( ) {cout < <"x=" < < x < <" " <"y=" < < y < < endl;} void show( ) const{cout < <"x=" < <" " < <"y=" < < y < < endl;} privated: int x; int y; }; void main( ) { Myclass my1(3,4) ; const my2(7,8) ; my1.show( ) ;my2.show( ) ;}A.x=4,y=3;x=7,y=8B.x=3,y=4;x=7,y=8C.x=7,y=8;x=4,y=3D.x=8,y=7;x=7,y=8
考题
下列程序的输出结果是includeclass Myclass{public : Myclass( int i=0,int j=0){x
下列程序的输出结果是 #include<iostream.h> class Myclass{ public : Myclass( int i=0,int j=0) {x=i; y=j; } void show( ){cout<<"x="<<x<<" "<"y="<<y<<endl;} void show( )const{cout<<"x="<A.x=4,y=3;x=7,y=8B.x=3,y=4;x=7,y=8C.x=7,y=8;x=4,y=3D.x=8,y=7;x=7,y=8
考题
有以下程序段:include define MIN(x,y)(x)
有以下程序段:include<iostream.h>define MIN(x,y) (x)<(y)?(x):(y)void main(){int i,j,K;i=10;j=15;k=10*MIN (i,j);cout<<k<<endl;}程序执行后的输出结果是______。
考题
以下程序运行后的输出结果是______。includeinclude usingnamespacestd;classY
以下程序运行后的输出结果是______。include <iostream>include <string>using namespace std;class Y;class X{int x;char *strx;public:X(int a, char *str){x=a;strx=new char[strlen(str)+1]strcpy (strx,str);}void show(Y ob);};class Y{prlvate:int y;char *stry;public:Y(int b,char *str){y=b;stry=new char[strlen(str)+1];strcpy(stry,str);}friend void X::show(Y ob);};void X::show{Y ob){cout<<strx<<",",cout<<ob.stry<<endl;}int main{{X a (10, "stringX");Y b (20, "stringY");a. show (b);renurn 0;}
考题
有以下程序:includevoid main(){ int x=5,y=2; cout
有以下程序: #include<iostream.h> void main() { int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%3)<<","; cout<<(x>0y<0)<<","; cout<<(x!=y‖x>=y)<<endl: } 程序执行后的输出结果是( )A.0,0,0,1B.1,1,1 1C.0,0, 1,1D.1,1,0,0
考题
下列程序段的输出结果是includevoid fun(int * x,int * y){cout
下列程序段的输出结果是 #include<iostream.h> void fun(int * x,int * y) { cout << * X << * y; *X=3; *y=4; } void main() { int x=1,y=2; fun(y,x); cout << X << y<<endl; {A.2143B.1212C.1234D.2112
考题
以下程序的执行结果是 ______。 include int max(int x,int y) { ret
以下程序的执行结果是 ______。include<iostream.h>int max(int x,int y){return(x>y? x:y);}void main(){int n=2,m=10;max(n,m)--;cout<<"n="<<n<<",m="<<m<<endl;}
考题
以下程序的输出结果是【】。 include int add(int x,int y) { retum X+y; } dOuble ad
以下程序的输出结果是【 】。include<iostream.h>int add(int x,int y){retum X+y;}dOuble add(dOUble x,double y){return x+y;}void main(){int a=4,b=6;double c=2.6,d=7.4;cout<<add(a,b)<<",”<<add(C,d)<<endl;}
考题
下列程序的执行结果是( )。 #inClude<iostream.h) #include(stdlib.h) class TestClass { public: int x,y; TestClass(){x=y=0;} TestClass(int a,int b){x=a;y=b;} void disp() { cout<<"x="<<x<<",y="<<y<<endl; } }; void main() {A.x=2,y=2B.x=2,y=3C.x=3,y=2D.x=3,y=3
考题
以下程序执行后的输出结果是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.不确定
考题
下列程序的执行结果是( )。 #includeiostream.h classSample { intx,y; public: Sample(){x=y=0;} Sample(inta,intb){x=a;y=b;} ~Sample() { if(x==y) cout"x=y"endl; else cout"x!=y"endl; } voiddisp() { cout"x="x",y="yendl;} }; voidmain() { Samples1(2,3); s1.disp(); }A.x=2,y=2B.x=3,y=3C.x=2,y=3D.x=3,y=2
考题
若运行时给变量x输入12,则以下程序的运行结果是includevoid main(){int x,y;cin>>x
若运行时给变量x输入12,则以下程序的运行结果是 #include<iostream.h> void main() { int x,y; cin>>x; y=X>12?x+10:x-12; cout<<y; cout<<endl; }A.0B.22C.12D.10
考题
如下程序的输出结果是main( ){float x=2.0,y;if(x<0.0)y=0.0;else if(x<10.0)y=1.0/x;elsey=1.0;cout<<y<<endl;}A.0.000000B.0.250000C.0.500000D.1.000000
考题
若运行时给变量x输入12,则以下程序的运行结果是include void main(){ int x,y; cin
若运行时给变量x输入12,则以下程序的运行结果是 #include <iostream.h> void main() { int x,y; cin>>x; y=x>12? x+10:x-12; cout<<y; cout<<endl; }A.0B.22C.12D.10
考题
以下程序执行后的输出结果是()。includeusing namespace std;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<<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 void fun(int * X,int * y) {cout
下列程序段的输出结果是 #include<iostream.h> void fun(int * X,int * y) { cout < < * X < < * y; * X=3; * y=4; } void main( ) { int x=1,y=2; fun(y,x); cout < < X < < y < < end1; }A.2143B.1212C.1234D.2112
考题
下列程序的输出结果是includeclass Myclass{ public:My class(inti=0,int j=0) {x=
下列程序的输出结果是 #include<iostream.h> class Myclass{ public:My class(inti=0,int j=0) { x=i; y=j; } void show(){cout<<"x=" <<x<<" " <"y=" <<y<<endl;} void show()const{cout<<"x="<<""<<"y="<<y<<endl;} privated: int x; int y; }; void main() { Myclassmy1(3,4); const my2(7,8); myl.show();my2.show();}A.x=4,y=3;x=7,y=8B.x=3,y=4;X=7,y=8C.x=7,y=8;x=4,y=3D.x=8,y=7;x=7,y=8
考题
以下程序输出的结果是()。includeusing namespace std;int main(){int **x,*y,z=10;y=
以下程序输出的结果是( )。 #include<iostream> using namespace std; int main() { int **x,*y,z=10; y=z; x=y; cout<< **x+1<<endl; return 0; }A.11B.x的地址C.y的地址D.运行错误
热门标签
最新试卷