请选出以下程序的输出结果( )。 #include <stdio.h> sub(int *s,int y) { static int t=3; y=s[t];t--; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x); } printf("\n"); }
A.1234
B.4321
C.0
D.4444
第1题:
运行程序,程序输出结果是(). void sub (int *s, int *y ) { static int t=3 ; *y=s[t] ; t - -; } int main() { int a[ ]={1,2,3,4}, i , x=0; for (i = 0; i<4; i++) { sub (a,&x ) ; cout<<x;} cout<<endl; return 0 ; }
A.4321
B.1234
C.0000
D.4444
第2题:
请选出以下程序的输出结果_______。 #include<stdio.h> sub(int*s,inty) { static int t=3, y=s[t];t-; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++){ sub(a,x);printf("%d",x);} printf("\n"); }
A.1234
B.4321
C.0
D.4444
第3题:
请选出以下程序的输出结果 #include<stdio.h> main() { int a[]={1,2,3,4},i; int x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x);} printf("\n");} sub(s,y) int*s,y; { static int t=3; y=s[t];t--; }
A.1 2 3 4
B.4 3 2 1
C.0
D.4444
第4题:
下列程序的运行结果是( )。 #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,
第5题:
下列程序的运行结果是( )。
#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,
第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>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,
第8题:
以下程序的输出结果是______。
include <stdio.h>
void swap(int *a, int *b)
{ int *t;
}
{ int i=3,j=5,*p=&i,*q=&j;
swap(p,q); printf("%d %d\n",*p,*q);
第9题:
请选出以下程序的输出结果
#include<stdio.h>
main()
{ int a[]={1,2,3,4},i;
int x=0;
for(i=0;i<4;i++)
{ sub(a,x);printf("%d",x);}
printf("\n");}
sub(s,y)
int *s,y;
{ static int t=3;
y=s[t];t--; }
A.1 2 3 4
B.4 3 2 1
C.0 0 0 0
D.4 4 4 4