下面程序的输出结果是( )。 #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.24
B.12
C.48
D.36
第1题:
下列程序运行后的输出结果是( )。 #include<iostream.h> void fun(int,int,int*); void main() { int x,y,z; fun(5,6,&x); fun(7,x,&y); fun(x,y,&z); cout<<x<<","<<y<<","<<z<<end1; } void fun(int a,int b,int *c) { b+=a; *c=b-a; }
A.5, 5, 5
B.6, 6, 6
C.5, 6, 7
D.7, 7, 7
第2题:
下面程序的运行结果是 #include<iostream,h> void fun(int*a,int*b) { int X= *a; * a= *b; *b=X; cout<< *a<< *b<<" "; void main() int x=1, y=2; fun(&x,&y); cout<<X<<y<<end1; }
A.12 12
B.12 21
C.21 12
D.21 11
第3题:
下列程序段的输出结果是 #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.2143
B.1212
C.1234
D.2112
第4题:
下列程序运行后的输出结果是( )。 #include<iostream.h> void fun(int,int,int*); void main() { int x,y,z; fun(5,6,&x); fun(7,x,&y); fun(x,y,&z); cout<<x<<","<<y<<","<<z<<endl; } void fun(int a,int b,int *c) { b+=a; *c=b-a; }
A.5,5,5
B.6,6,6
C.5,6,7
D.7,7,7
第5题:
以下程序的输出结果是#include "stdio.h"int *fun(int *a,int *b){ int m; m=*a; m+=*b-3; return(&m);}main(){ int x=21,y=35,*a=&x,*b=&y; int *k; k=fun(a,b); printf("%d\n",*k);}
第6题:
下列程序段的输出结果是 #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.2143
B.1212
C.1234
D.2112
第7题:
下面程序的运行结果是( )。
include<stdio.h>
main()
{int a=25;
fun(&A);
}
fun(int *x)
{ printf("%d\n",++*x);
}
第8题:
下面程序的运行结果是
#include<iostream.h>
void fun(int * a,int * b)
{
int x= * a;
* a= * b; * b=X;
cout < < * a < < * b < <" ";
}
void main( )
{
int x=1,y=2;
fun(&x,&y) ;
cout < < X < < y < < endl;
}
A.12 12
B.12 21
C.21 12
D.21 21
第9题:
下面程序的运行结果是 #include<iostream.h> void fun(int * a,int * b) { int x= * a; * a = * b; * b=x; cout <<*a<< *b<<""; } void main( 0 { int x =1,y =2; fun(&x,&y); cout<< x << y <<end1; }
A.12 12
B.12 21
C.21 12
D.21 21