下列程序的运行结果是( )。 #include<stdio.h> void fun(int*S,int*p) { static int t=3: *p=s[t]; t--; } void main { int a[]={2,3,4,5),k; int x; for(k=0,k<4,k++) { fun(a,&x); printf("%d,",x); } }
A.5,4,3,2
B.2,3,4,5
C.2,2,2,2
D.5,5,5,5
第1题:
有以下程序: #include<stdio.h> #include<stdlio.h> void fun(int*pl,int*p2,int*s) { s=(int*)malloc(sizeof(int)); *s=*pl+*p2; free(s); } main( ) { int a=1,b=40,*q=&a; fun(&a,&b,q); printf("%d\n",*q); } 程序运行后的输出结果是( )。
A.42
B.0
C.1
D.41
第2题:
下列程序的运行结果是( )。 #include<stdio.h> void fun(int*s,int*p) { static int t=3; *p=s[t]; t--; } void main() { int a[]={2,3,4,5},k; int x; for(k=0;k<4;k++) { fun(a,&x); printf("%d,",x); } }
A.5,4,3,2
B.2,3,4,5,
C.2,2,2,2,
D.5,5,5,5,
第3题:
下列程序的运行结果是( )。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=&a,*y=&b; fun(x, y) ; cout<<a<<" "<<b<<endl:}
A.20049
B.92004
C.0
D.编译时出错
第4题:
有以下程序#include <stdio.h>#include <stdlib.h>int fun(int t){ int *p; p=(int*)malloc(sizeof(int)); *p=t; return *p;}main(){ int a; a = fun(8); printf("%d\n", a+fun(10));}程序的运行结果是A.0 B.10 C.18 D.出错
第5题:
下列程序的运行结果是( )。 #include<stdio.h> void fun (int*s,int*p) { static int t=3; *p=s [t]; t--; } void main() int a[]={2, 3, 4, 5},k; int x; for(k=0; k<4; k++) { fun (a, &x); printf("%d,", x); }
A.5,4,3,2
B.2,3,4,5,
C.2,2,2,2,
D.5,5,5,5,
第6题:
下列程序的运行结果是( )。#include<stdio.h>void fun(int*s,int*p){ static int t=3; *p=s[t]; t--;}void main(){ int a[]={2,3,4,5),k; int x; for(k=0;k<4;k++) { fun(a,&x); printf("%d,",x); }}
A.5,4,3,2
B.2,3,4,5,
C.2,2,2,2,
D.5,5,5,5,
第7题:
下列程序的运行结果是( )。
#include<stdio.h>
voidfun(int*s,int*p)
{ static int t=3;
*p=s[t];
t--;
}
void main()
{ int a[]={2,3,4,5},k;
int x;
for(k=0;k<4;k++)
{ fun(a,&x);
printf("%d,",x);
}
}
A.5,4,3,2
B.2,3,4,5,
C.2,2,2,2,
D.5,5,5,5,
第8题:
以下程序的输出结果是______。 fun(int *s,int *p) { static int t=3; *p=s[t]; t--; } main() { int str[]={1,2,3,4},i,m=0; for(i=0;i<4;i++) {fun(str,&m); printf("%d",m); } printf("\n"); }
A.0
B.444412
C.1234
D.4321
第9题:
以下程序运行后,输出结果是______。 fun(int**s,int p[2][3]) {**s=p[1][1]; } main() { int a[2][3]={1,3,5,7,9,11},*p; p=(int *)malloc(sizeof(int)); fun(&p,a); printf("%d\n",*p); }
A.1
B.7
C.9
D.11
第10题:
以下程序的输出结果是______。 fun(int **s,int p[2][3]) { **s=p[1][1]; } main() { int a[2][3]={1,3,5,7,9,11},*p; p=(int *)malloc(sizeof(int)); fun(&p,a); printf("%d\n",*p); }
A.1
B.7
C.9
D.11