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

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

有以下程序

struct S{ int n; int a[20]; }; void f(int *a,int n) {int i; for(i=0;i a[i]+=i; } main() {int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(s.a, s.n); for(i=0;i printf(“%d”,s.a[i]); } 程序运行后的输出结果是( )。

A.2,4,3,9,12,12,11,11,18,9,

B.3,4,2,7,9,8,6,5,11,10,

C.2,3,1,6,8,7,5,4,10,9,

D.1,2,3,6,8,7,5,4,10,9,


参考答案

更多 “ 有以下程序struct S{ int n; int a[20]; }; void f(int *a,int n) {int i; for(i=0;i a[i]+=i; } main() {int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(s.a, s.n); for(i=0;i printf(“%d”,s.a[i]); } 程序运行后的输出结果是( )。A.2,4,3,9,12,12,11,11,18,9,B.3,4,2,7,9,8,6,5,11,10,C.2,3,1,6,8,7,5,4,10,9,D.1,2,3,6,8,7,5,4,10,9, ” 相关考题
考题 有以下程序struct S{ int n; int a[20]; };void f(int *a,int n){ int i;for(i=0;in-1;i++) a[i]+=i;}main( ){ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}};f(s.a,s.n);for(i=0;is.n;i++) printf("%d",s.a[i]);}程序运行后的输出结果是A)2,4,3,9,12,12,11,11,18,9,B)3,4,2,7,9,8,6,5,11,10,C)2,3,1,6,8,7,5,4,10,9,D)1,2,3,6,8,7,5,4,10,9,

考题 有以下程序inclUdevoidfun(int*s,intn1,intn2){inti,j,t;i=n1;j=n2;while(i 有以下程序 #inclUde <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1; j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4A.0987654321B.4321098765C.5678901234D.0987651234

考题 有以下程序: struct S{int n;int a[20];}; void f(int*a,int n) {int i; for(i=0;i<n-1;i++)a[i]+=i;} mainf() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; if(s.a,s.n); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。A.2,4,3,9,12,12,11,11,18,9B.3,4,2,7,9,8,6,5,11,10C.2,3,1,6,8,7,5,4,10,9D.1,2,3,6,8,7,5,4,10,9

考题 有以下程序 struct S { int n;int a[20];}; void f(int *a,int n) { int i; for(i=0;i<n-1;i++)a[i]+=i; } main() { int i;struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(s.a,s.n); for(i=0;i<s.n;i++)printf("%d,",s.a[i]); } 程序运行后的输出结果是A.2,4,3,9,12,12,11,11,18,9,B.3,4,2,7,9,8,6,5,11,10,C.2,3,1,6,8,7,5,4,10,9,D.1,2,3,6,8,7,5,4,10,9,

考题 以下程序的输出结果是 voidreverse(inta[],intn) {inti,t; for(i=0;i{t=a[i];a[i]=a[n- 以下程序的输出结果是void reverse(int a[],int n){ int i,t;for(i=0;i A.22B.10C.34D.30

考题 有以下程序:include define N 20fun(int a[] ,int n,int m){int i,j;for(i=m;i> :n;i 有以下程序: #include <stdio.h> #define N 20 fun(int a[] ,int n,int m) { int i,j; for(i=m;i> :n;i--) a[i+1] =a[i]; } main( ) { int i,a[N.] = 11,2.3,4,5,6,7,8,9,10[; fun( a,2,9) for(i =0;i<5;i ++ ) printf("% d" ,a[i] );程序运行后的输出结果是( )。A.10234B.12344C.12334D.12234

考题 有以下程序:include prt(int * m,int n)int i;for(i =0;i 有以下程序:#include <stdio.h>prt(int * m,int n) int i; for(i =0;i<n;i ++ ) m[i] ++;main( )} int a[ ] = { 1,2,3,4,5} ,i; prt(a,5); for(i =0;i<5;i ++ ) printf( "% d," ,a[i] );}程序运行后的输出结果是( )。A.1,2,3,4,5,B.2,3,4,5,6,C.3,4,5,6,7,D.2,3,4,5,1

考题 有以下程序 include void fun(int a[],int n) { int i,t; for(i=0; 有以下程序 #include <stdio.h> void fun(int a[],int n) { int i,t; for(i=0;i<n/2;i++) {t=a[i]; a[i]=a[n-1-i]; a[n-1-i]=t;} } main() {int k[10]={1,2,3,4,5,6,7,8,9,10},i; fun(k,5); for(i=2;i<8;i++) printf("%d",k[i]); printf("\n"); } 程序的运行结果是______。A.345678B.876543C.1098765D.321678

考题 有以下程序:struct S{int n;int a[20];};void f(struct S*P){int i,j,t;for(i=0;in-1;i++)fo 有以下程序: struct S{int n;int a[20];}; void f(struct S*P) { int i,j,t; for(i=0;i<P->n-1;i++) for(j=j+1;j<P->n-1;j++) if(p->a[i]>p->a[j]) {t=P->a[i];p->a[i]=P->a[j];p->a[j]=t} } main() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。A.3B.4C.5D.6