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

题目内容 (请给出正确答案)

有以下程序 void f(int v,int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d/n",x,y,z); }执行后输出结果是()

  • A、1,2,3
  • B、3,1,2
  • C、1,3,2
  • D、2,3,1

参考答案

更多 “ 有以下程序 void f(int v,int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(xy) f(x,y); else if(yz) f(y,z); else f(x,z); printf("%d,%d,%d/n",x,y,z); }执行后输出结果是()A、1,2,3B、3,1,2C、1,3,2D、2,3,1” 相关考题
考题 阅读下面程序: 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),}则该程序的输出结果是【 】

考题 有以下程序: void f(int v,int w) { int t; t=v;V=W;W=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d<%d\n",x,y,Z); } 执行后输出结果是( )。A.1,2,3B.3,1,2C.1,3,2D.2,3,1

考题 有以下程序:include void f(int a[],int i, int j){int t; if(i 有以下程序: #include <stdio.h> void f(int a[],int i, int j) { int t; if(i<j) { t=a[i];a[i]=a[j];a[j]=t; f(a,i+1,j-1); } } main() { int i,aa[5]={1,2,3,4,5}; f(aa,0,4); for(i=0;i<5;i++) printf("%d,",aa[i]);printf("\n"); } 执行后的输出结果是( )。A.5,4,3,2,1,B.5,2,3,4,1,C.1,2,3,4,5,D.1,5,4,3,2,

考题 以下程序的输出结果为【】。 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; int f(int); int main() {int i;for(i=0; 有以下程序:include <iostream>using namespace std;int f(int);int main(){int i;for(i=0;i<5;i++)cout<<f(i)<<" ";return 0;}int f(int i){static int k=1;for(;i>0;i--)k+=i;

考题 有以下程序: #includestdio.h int abe(int u,int v); main { int a=24,b一16,c; c=abc(a,b); printf("%d\n",c); } int abc(int u,int v) { int w; while(v) {w=u%v;u=v;v=w;) return; } 输出结果是( )。A.6B.7C.8D.9

考题 下面程序的输出结果是【】。 include using namespace std; int x; void funA(int,i 下面程序的输出结果是【 】。include<iostream>using namespace std;int x;void funA(int,int);void funB(int,int);int main(){int first;int second=5;x=6;funA(first,seconD) ;fimB(first,seconD) ;cout<<first<<" "<<second<<" "<<x<<end1;return 0;}void funA(int a,int B){int first;first=a+b;a=2*b;b=first+4;}void funB(int u,int v){int second;second=x;v=second+4;x=u+v;}

考题 下面程序的输出结果是______。 include using namespace std; int x; void funA(int,int);void funB(int,int);int main(){int first;int second=5;x=6;funA(first,second);funB(first,second);cout<<first<<””<<second<<””<<x<<endl;return 0;}void funA(int a,int b){int first;first=a+b;a=2*b;b=first+4;}void funB(int u, int v){int second;second=x;v=second+4;x=u+v;}

考题 下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}

考题 分析以下程序执行结果【】。 include int f (int x, int y){return x,y; } double f (d 分析以下程序执行结果【 】。include<iostream.h>int f (int x, int y){return x,y;}double f (double x, double y) {return x,y;}void main() {int a=4, b=6;double c=2.6, d=7.4;cout<<f (a, b) <<","<<f (c, d) <<end1;}

考题 有以下程序:include void f(int v, int w){int t; t=v; v=w; w=t;}main(){int x=1,y=3 有以下程序: #include <stdio.h> void f(int v, int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d\n",x,y,z); } 执行后的输出结果( )。A.1,2,3B.3,1,2C.1,3,2D.2,3,1

考题 有以下程序inclube class ClassOne{public: ClassOne(int v=O) { i=v;cout 有以下程序 #inclube <iostream.h> class ClassOne { public: ClassOne(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} }; class ClassTwo { public: ClassTwo(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} private: ClassOne myObj; int i; }; void main() { ClassTwo obj(1); obj.print(); }A.11B.111C.110D.101

考题 有以下程序 include void fun(int n, int *p) { int f1,t2; if(n==1 | 有以下程序 #include <stdio.h> void fun(int n, int *p) { int f1,t2; if(n==1 ||n==2) *p=1; else { fun(n-1,f1); fun(n-2,f2); *p=f1+f2; } } main() { int s; fun(3,s); printf("%d\n", s ); }A.2B.3C.4D.5

考题 以下程序的执行结果是______。 include class A{ int a: public: void seta(int x) { 以下程序的执行结果是______。include<iostream.h>class A{int a:public:void seta(int x) {a=x;}void showa() {cout<<a<<end1;}};class B{int b;public:void setb(int x) {b=x;}void showb(){cout<<b<<end1;}};

考题 有以下程序()。includeint f(int n){if(n==1)return 1;elsereturn f(n-1)+1;}void m 有以下程序( )。 #include<iostream.h> int f(int n) { if(n==1)return 1; else return f(n-1)+1; } void main() { int i,j=-; for(i=1;i<3;i++) j+=f(i); cout<<j<<endl; } 程序运行后输出结果是( )。A.4B.3C.2D.1

考题 有以下程序includevoid f(int *p,int *q);main(){ int m=1,n=2,*r=m;f(r, n 有以下程序 #include<stdio.h> void f(int *p,int *q); main() { int m=1,n=2,*r=m; f(r, n); printf("%d,%d",m,n); } void f(int*p,int*q) {p=p+1; *q=*q+1;) 程序运行后的输出结果是______。A.1,3B.2,3C.1,4D.1,2

考题 有以下程序:include using namespace std;class A{public: A(int i,int j) { a=i; b= 有以下程序: #include <iostream> using namespace std; class A { public: A(int i,int j) { a=i; b=j; } void move(int x,int y) { a+=x; b+=y; } void show() { cout<<a<<","<<b<<end1; } private: int a,b; }; class B: private A { public: B(int i,int j): A(i,j) {} void fun() { move(3,5); } void fl () { A::show(); } }; int main() { B d(3,4); d.fun(); d.f1(); return 0; } 程序执行后的输出结果是A.3,4B.6,8C.6,9D.4,3

考题 有以下程序:include using namespacestd;class A{public:A(int i,int j){ a=1; b=j;} 有以下程序:#include <iostream>using namespace std;class A{public: A(int i,int j) { a=1; b=j; } void move (int x,int y) { a+=x; b+=y; } void show() cout<<a<<","<<b<<end1 } private: int a,b; }; class B : private A { public: B(int i,int 3):A (i,j) {} void fun() { move (3,5); } void f1() { A::show(); } }; int main() { B d(3,4); d.fun(); d.f1(); return 0; } 程序执行后的输出结果是A.3,4B.6,8C.6,9D.4,3

考题 以下程序的正确运行结果是()。includeint f(int);void main(){int a=2,i;for(i=0;i 以下程序的正确运行结果是( )。 #include<iostream.h> int f(int); void main() { int a=2,i; for(i=0;i<3;i++)cout<<f(a)<<" "; cout<<endl; } int f(int a) { int b=0; static int c=3; b++;c++; return(a+b+c); }A.777B.7 10 13C.7 9 11D.7 8 9

考题 有以下程序:include using namespace std;class A{private: int x,y;public: void se 有以下程序: #include <iostream> using namespace std; class A { private: int x,y; public: void set (int i,int j) { x=i; y=j; } int get_y() { return y; } }; class box { private: int length,width; A label; public: void set(int 1,int w, int s,int p) { length=1; width=w; label.set(s,p); } int get_area() { return length*width; } }; int main() { box small; small.set(2,4,1,35); cout<<small.get_area()<<end1; return 0; } 运行后的输出结果是( )。A.8B.4C.35D.70

考题 有以下程序:#includestdio.hint abe(int u,int v);main{ int a=24,b一16,c;c=abc(a,b);printf(%d\n,c);}int abc(int u,int v){ int w;while(v){w=u%v;u=v;v=w;)return;}输出结果是( )。A.6B.7C.8D.9

考题 有以下程序: int f1(doubleA){return a*a;} int f2(int x,int y) {double a,b; a=f1(x); b=f1(y); return a+b; } main() {double w; w=f2(2.1,4.0); } 程序执行后,变量w的值是( )。A.20.21B.20C.20.0D.0.0

考题 有以下程序()。 include int f(int n) { if(n==1)return l; else return f(n-1)+1; 有以下程序( )。 #include<iostream.h> int f(int n) { if(n==1)return l; else return f(n-1)+1; } void main() { int i,j=-; for(i=1;i<3;i++) j+=f(i); cout<j<<endl; } 程序运行后输出结果是( )。A.4B.3C.2D.1

考题 下面程序的输出结果是()。include using namespace std;int fun (int, int);//fun ( ) 下面程序的输出结果是( )。 #include <iostream> using namespace std; int fun (int, int); //fun ( ) 函数的说明 void main( ) { int a =48,b =36,c; c = fun(a,B) ; cout<<c; } int fun(int u,int v) { int w; while (v) {w=u%v;u =v;v =w;} return u; }A.24B.12C.48D.36

考题 若有以下程序include using namespace std;class A{public: A(int i,int j) {a=i;b=j 若有以下程序 #include <iostream> using namespace std; class A { public: A(int i,int j) { a=i; b=j; } void move(int x, int y) { a+=x; b+=y; } void show() { cout < <a < <" , " <<b<< end1; } private: int a,b; }; class B : private A { public: B(int i,int j) :A(i,j) {} void fun ( ) { move (3, 5); } void f1 ( ) { A::show(); } }; int main ( ) { B d(3,4); d. fun ( ); d.f1(); return 0; } 程序执行后的输出结果是 ( )。A.3,4B.6,8C.6,9D.4,3

考题 有以下程序: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

考题 以下程序输出结果是 ______。includevoid n(int i);void f2(int i);char st[]=”Howd 以下程序输出结果是 ______。 #include<iostream.h> void n(int i); void f2(int i); char st[]=”Howdoyoudo!”; void fl(int i){ cout<<st[i]; if(i<3){ i+=2: f2(i): } } void f2(int i) { cout<<st[i]; if(i<3) { i+=2; f1(i); } } void main() { int i=0; f1(i); }A.HowB.doC.HwoD.Hwoy

考题 单选题有以下程序:#include void f(int*p,int*q);main(){ int m=1,n=2,*r=m; f(r,n); printf("%d,%d",m,n);}void f(int*p,int*q){ p=p+1; *q=*q+1;}程序运行后的输出结果是(  )。A 1,3B 2,3C 1,4D 1,2