单选题有以下程序:#include #define N 4void fun(int a[][N]){ int i; for(i=0;iA16,6,11,16,B1,6,11,16,C4,7,10,13,D17,17,17,17,

单选题
有以下程序:#include #define N 4void fun(int a[][N]){ int i; for(i=0;i
A

16,6,11,16,

B

1,6,11,16,

C

4,7,10,13,

D

17,17,17,17,


参考解析

解析:
fun函数给数组的第一列重新赋值,主函数调用fun(x)后,x[0][0] = x[3][3] = 16,x[0][1] = x[3][2] = 15,x[0][2] = x[3][1] = 14,x[0][3] = x[3][0] = 13.程序最后输出x[0][0],x[1][1],x[2][2],x[3][3],答案选择A选项。

相关考题:

有以下程序#include stdio.h#define N 4void fun(int a[][N], int b[]){ int i;for(i=0;iN;i++) b[i] = a[i][i];}main(){ int x[][N]={{1,2,3},{4},{5,6,7,8},{9,10}},y[N],i;fun(x,y);for(i=0;iN;i++) printf("%d,",y[i]);printf("\n");}程序的运行结果是A)1,2,3,4,B)1,0,7,0,C)1,4,5,9,D)3,4,8,10,

该程序运行的结果是( )。#include#include#define M 100void fun(int m, int *a, int *n){ int i,j=0;for(i=1;i=m;i++)if(i%7==0||i==0)a[j++]=i;*n=j;}main(){ int aa[M],n,k;clrscr();fun(10,aa,n);for(k=0;kif((k+1) ==0)printf("\n");else printf("M",aa[k]);printf("\n");}

以下程序的运行结果是______。includemain(){ int fun();fun();}fun(){static int a[3]= 以下程序的运行结果是______。include<stdio.h>main(){ int fun();fun();}fun(){static int a[3]={0,1,2};int i;for(i=0;i<3;i++)a[i]+=a[i];for(i=0;i<3;i++)printf("%d,",a[i]);pfintf("\n",);}

下列程序的输出结果是 #include"stdio.h" #define N 3 #define M 3 void fun(int a[M][N]) { printf("%d\n",*(a[1]+2));} main() { int a[M][N]; int i,j; for(i=0;i<M;i++) for(j=0;j<N;j++) a[i][j]=i+j-(i-j); fun(a);}A.3B.4C.5D.6

有以下程序 #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]={1,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

有以下程序: # 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]={1, 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 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 void fun(iht * a,int i,int j){int t;if(i 有以下程序:#include <stdio, h>void fun(iht * a,int i,int j){ int t; if(i < j) { t=a[i];a[i] =a[j] ;a[j]=t; i++;j--; fun(a,i,j);main ( ) int x[ ]: {2,6,1,8} ,i; fun(x,0,3); for( i=0;i <4;i ++ ) printf( "%2d" ,x[i] ); printf(" \n");A.1268B.8621C.8162D.8612

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

有以下程序 include define N 4 void fun(int a[][N],int b[]) { int 有以下程序 #include <stdio.h> #define N 4 void fun(int a[][N],int b[]) { int i; for(i=0;i<N;i++) b[i]=a[i][i]; } main() {int x[][N]={{1,2,3},{4},{5,6,7,8},{9,10} },Y[N],i; fun(x,y); for(i=0;i<N;i++) printf("%d,",y[i]); printf("\n"); } 程序的运行结果是______。A.1,2,3,4,B.1,0,7,0,C.1,4,5,9,D.3,4,8,10,

有以下程序 include int fun(int (*s)[4],int n,int k) {int m,i; 有以下程序 #include <stdio.h> int fun(int (*s)[4],int n,int k) {int m,i; m=s[0][kl; for(i=1;i<n;i++) if(s[i][k]>m) m=s[i][k]; return m; } main() { int a[4][4]={{1,2,3,4},{11,12,13,14}, {21,22,23,24}, {31,32,33,34}}; printf("%d\n",fun(a,4,0)); } 程序的运行结果是______。A.4B.34C.31D.32

下列程序的输出结果是 #include"stdio.h" #define N3 #define M3 void fun(int a[M][N]) { printf("%d\n",*(a[1]+2));} main() { int a[M][N]; int i,j; for(i=0;i<M;i++) for(j=0;j<N;j++) a[i][j]=i+j-(i-j); fun(a);}A.3B.4C.5D.6

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

以下程序的输出结果是#include conio.h#include stdio.h#define M 100void fun(int m, int *a, int *n){ int i,j=0; for(i=1;i=m;i++) if(i%7==0||i%11==0) a[j++]=i; *n=j;}main(){ int aa[M],n,k; clrscr(); fun(100,aa,n); for(k=0;kn;k++) if((k+1)%20==0)printf("\n"); else printf("%d",aa[k]); printf("\n"); }

有以下程序:include fun( char p[] [10]){int n=0,i; for(i=0;i 有以下程序:#include <stdio.h>fun( char p[] [10]){ int n=0,i; for(i=0;i<7;i ++) if(p[i][0] =='T') n++; return n;}main( ){ char sir[] [10] = { "Mon" ,"Tue" ,"Wed" ,"Thu" ,"Fri" ,"Sat" ,"Sun" }; prlnff(" % d\n" ,fun(str) );}程序执行后的输出结果是( )。A.1B.2C.3D.0

有以下程序#includestdio.h#define N 4void fun(int a[][N],int b[]){ int i;for(i=0;iN;i++)b[i]=a[i][i]-a[i][N-1-i];}main(){ int x[N][N]:{{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},y[N],i;fun(x,y);for(i=0;iN;i++) prinff("%d,",y[i]);printf("\n");}程序运行后的输出结果是A.-12,-3,0,0,B.-3,-1,1,3,C.0,1,2,3,D.-3,-3,-3,-3,

有以下程序:include int fun(int x[], int n){ static int sum =0,i;for(i=0;i 有以下程序: #include <stdio.h> int fun(int x[], int n) { static int sum =0,i; for(i=0;i<n;i ++ )sum + =x[i]; return sum;{ int a[] ={1,2,3,4,5},b[]={6,7,8,9},s=0; s = fun(a,5) + fun(b,4) ;printf( "%d \n",s);程序执行后的输出结果是( )。A.45B.50C.60D.55

有以下程序: #include #define N 4 void fun(int a[ ][N],int b[ ]) { int i; for(i=0;i main( ) { int i,j,x=0; for(i=0;iA.x=4B.x=6C.x=8D.x=12

试题28有以下程序#include stdio.h#define N 4void fun(int a[][N], int b[]){ int I;for(i=0; iN; i++) b[i]=a[i][i]-a[i][N-1-i];}main(){ int x[N][N]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},y[N], i;fun(x,y);for(i=0;iN;i++) printf(“%d,”, y[i]); printf(“\n”);}程序运行后的输出结果是()A.-12,-3,0,0,B.-3,-1,1,3C.0,1,2,3,D..-3,-3,-3,-3

下列程序的输出结果是#include "stdio.h"#define N 3#define M 3void fun(int a[M][N]){printf("%d\n",*(a[1]+2));}main(){int a[M][N];int i,j;for(i=0;iM;i++)for(j=0;jN;j++)a[i][j]=i+j-(i-j);fun(a);}A.3B.4C.5D.6

单选题有以下程序:#include#define N 3void fun(int a[ ][N],int b[ ]){ int i,j; for(i=0;i {  b[i]=a[i][0];  for(j=i;j   if(b[i] }}main(){ int x[N][N]={1,2,3,4,5,6,7,8,9},y[N],i; fun(x,y); for(i=0;i printf("");}程序运行后的输出结果是(  )。A2,4,8,B3,6,9,C3,5,7,D1,3,5,

单选题有以下程序:#include#define N 3void fun(int a[ ][N],int b[ ]){ int i,j; for(i=0;iA2,4,8,B3,6,9,C3,5,7,D1,3,5,

单选题有以下程序:#include void fun(int n){ int i; if((i=n/10)!=0)  fun(i); putchar(n%10+'0');}main(){ fun(256);}程序运行后的输出结果是(  )。A256B652C2560D52

单选题有以下程序#include int fun(int x[],int n){ static int sum=0,i; for(i=0;iA50B60C45D55

单选题有以下程序:#include #define N 4void fun(int a[][N],int b[]){ int i; for(i=0;iA1,2,3,4,B1,0,7,0,C1,4,5,9,D3,4,8,0,

单选题有以下程序:#include #define N 4void fun(int a[][N],int b[]){ int i; for(i=0;iA12,-3,0,0,B-3,-1,1,3,C0,1,2,3,D-3,-3,-3,-3,

单选题若有以下程序#include #define N 4void fun(int a[][N], int b[], int flag){ int i,j; for(i=0; i a[i][j]) : (b[i] a[i][j]))  b[i] = a[i][j]; }}main(){ int x[N][N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, y[N],i; fun(x,y,1); for (i=0; iA1,2,3,4,13,14,15,16,B4,8,12,16,1,5,9,13, C1,5,9,13,4,8,12,16,D13,14,15,16,1,2,3,4,