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

题目内容 (请给出正确答案)
以下程序执行后的输出结果是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.18

B.9

C.10

D.不确定


参考答案

更多 “ 以下程序执行后的输出结果是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 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 A{ int x; public: A(int 程序的输出结果是【 】。include <iostream>using namespace std;class A{int x;public:A(int x=1):x(x){cout<<x;}};void main(){A a,b(2),c(3);}

考题 若有以下程序: include using namespace std; int f(int x, int y) {return(y-x)*x; 若有以下程序:include <iostream>using namespace std;int f(int x, int y){return (y-x)*x;}int main(){int a=3,b=4,c=5,d;d=f(f(a,b) ,f(a,c) );cout<<d<<<end1;return 0;}执行后的输出结果是【 】。

考题 若有以下程序段:include using namespace std;int main (){ int a[]={1,4,5}; int *p 若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2

考题 以下程序执行后的输出结果是( )。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.不确定

考题 以下程序的输出结果为【】。 include using namespace std; void initialize(int printNo 以下程序的输出结果为【 】。include<iostream>using namespace std;void initialize(int printNo,int state=0);void initialize(int printNo=l,int state);int main(){initialize();return 0;}void initialize(int printNo,int state){cout<<printNo<<","<<state<<end1;}

考题 以下程序的输出结果是【】。 include using namespace std; void fun() {static int a=0 以下程序的输出结果是【 】。include <iostream>using namespace std;void fun(){static int a=0;a+=2;cout<<a;}int main(){int CC;for(CC=1;cc<4;CC++)fun();cout<<end1;return 0;}

考题 下列程序的输出结果是______。 include using namespace std; void fun(int rf) { 下列程序的输出结果是______。include<iostream>using namespace std;void fun(int rf){rf*=2;}int main(){int num=500;fun(num);cout<<num<<endl;return 0;}

考题 有如下程序: include using namespace std; void f1(int x, int y){int z= 有如下程序:#include<iostream>using namespace std;void f1(int x, int y){int z=x; x=y; y=z;)void f2(int x, int y){int z=x; x=y; y=z;}intmain(){int x=10, y=26;f1(x, y);f2(x, y);cout<<y<<end1;return 0;}运行时的输出结果是( )。A) 10B) 16C) 26D) 36A.B.C.D.

考题 若有以下程序:include using namespace std;void sub(int x,int y, int *z){ *z = y+ 若有以下程序: #include <iostream> using namespace std; void sub(int x,int y, int *z) { *z = y+x; } int main() { int a,b, c; sub (8,4,a) ; sub (6, a, b) ; sub(a,b,c) ; cout<<a<<", "<<b<<", "<<c<<end1; return 0; } 程序运行后的输出结果是( )。A.12,18,30B.-12,6,8C.6,8,10D.12,-18,16

考题 下面程序输出的结果是( )。 include using namespace std; void swap(int 下面程序输出的结果是( )。 #include <iostream> using namespace std; void swap(int a,int b){ int temp; temp=a; a=b; b=temp; } void main(){ int x=2; int y=3; swap(x,y); cout<<x<<y; }A.23B.32C.abD.ba

考题 以下程序输出结果是():includeusing namespace std;void add(int X,int y,int *z){*z 以下程序输出结果是( ): #include<iostream> using namespace std; void add(int X,int y,int *z) { *z=y+x; } int main() { int a,b,c; add(8,4,a); add(6,a,b); add(a,b,c); cout<<a<<","<<b<<","<<c<<end1; return 0;A.12,10,14B.12,18,30C.12,6,18D.12,14,30

考题 执行以下程序后的输出结果为 ( )。includeUsing namespace std;void fun(int x, int y 执行以下程序后的输出结果为 ( )。#include<iostream>Using namespace std;void fun(int x, int y, int *cp, int *dp) {*cp=x+ y; 2*dp=x- y;}void maia() {int a, b, c, d; a=30; b=50; fun(a, b, c, d); cout<<c<<','<,d<<end1;}A.50, 30B.30, 50C.80, 20D.80, 20

考题 下面程序执行的结果是【 】 include using namespace std; class A{ public: static in 下面程序执行的结果是【 】include<iostream>using namespace std;class A{public:static int x;A(inty){cout<<x+y;}};int A::x=2;void main(){A a(5);}

考题 下列程序运行时的输出结果是______。 include using namespace std; void Xfun(intvoid Xfun(int, int);int main(){int a=3, b=4;Xfun(a, B) ;cout<<a*a+b<<end1;return 0;}void Xfun(int x, int y){int z=x;x=y; y=z;}

考题 请填写空格: include using namespace std; void fun(int x,int y,int * z) { *2 = x 请填写空格:include<iostream>using namespace std;void fun(int x,int y,int * z){ *2 = x + y;}void main(){int a=100,b=100,c,*p=c;fun(a,b,p);【 】; //输出调用fun函数后返回a、b的和。}

考题 若有以下程序:include using namespace std;class A{private: int x;protected: int 若有以下程序: #include <iostream> using namespace std; class A { private: int x; protected: int y; public: int z; void setx(int i) { x=i; } int getx () { return x; }; class B : protected A { public: void setvalue(int a, int b, int c) { setx (a); y=b; z=c; } void display() { cout<<getx ( ) <<", "<<y<<", "<<z<<", "<<end1; } }; int main () { B obj; obj.setvalue(5, 6, 7); obj.display ( ); return 0; } 程序运行后的输出结果是( )。A.产生语法错误B.7,6,5C.5,6,7D.7,5,6

考题 以下程序执行后输出的结果是【】。 include using namespace std; int fac(int a,int b){ 以下程序执行后输出的结果是【 】。include<iostream>using namespace std;int fac(int a,int b){return(b-a)*a;}int main(){int x=3,y=4,z=5,result;result=fac(fac(x,y),fac(x,z));cout<<result<<endl;return 0;}

考题 下面程序的运行结果是【】。 include using namespace std; void fun(inta,int b=3) 下面程序的运行结果是【 】。include <iostream>using namespace std;void fun(int a, int b=3){static int i=2;a = a + b + i;i = i + a;}int main(){int x=5, y=2;fun(x, y);cout<<x<<",";fun(x);cout<<x<<end1;return 0;}

考题 如下程序执行后的输出结果是【】。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 fun(int i,int j){ cout 有以下程序: #include <iostream> using namespace std; void fun(int i,int j) { cout<<(i+j)<<end1; } void fun(int i) { cout<<i++<<end1; } int main() { int a=1; fun(A) ; return 0; } 该程序执行后的输出结果是( )。A.1B.2C.3D.4

考题 若有以下程序:include using namespace std;class A{private:int a;public:void seta 若有以下程序:#include <iostream>using namespace std;class A{private: int a;public: void seta(int x) { a=x; } void showa() { cout<<a<<","; }};class B{private: int b;public: void setb(int x) { b=x; } void showb() { cout<<b<<","; }};class C: public A, private B{private: int c;public: void setc(int x, int y, int z) { c=z; seta(x); setb(y); } void showc() { showa(); showb(); cout<<c<<end1; }};int main(){ C c; c.setc(1,2,3); c.showc(); return 0;}程序执行后的输出结果是( )。A.1,2,3B.1,1,1C.2,2,2D.3,3,3

考题 以下程序执行后的输出结果是includeusing namcspace std;void try(int,int,int,int); 以下程序执行后的输出结果是 #include<iostream> using namcspace 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.不确定

考题 下面程序输出的结果是( )。 include using namespace std; class A{ 下面程序输出的结果是( )。 #include<iostream> using namespace std; class A{ int X; public: A(int x):x(++x){} ~A(){cout<<x;} }; class B:public A{ int y; public: B(int y):A(y),y(y){} ~B(){cout<<y;}; }; void main(){ B b(3); }A.34B.43C.33D.44

考题 以下程序执行后的输出结果是()。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.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.不确定

考题 以下程序输出的结果是()。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.运行错误