单选题若有以下程序#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,

单选题
若有以下程序#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; i
A

1,2,3,4,13,14,15,16,

B

4,8,12,16,1,5,9,13,

C

1,5,9,13,4,8,12,16,

D

13,14,15,16,1,2,3,4,


参考解析

解析:
考查数组名作为函数参数。函数fun的作用是如果flag为1则用b[i]记录a[i][0]至a[i][3](即当前行)中最小的值,若flag为0,则用b[i]记录a[i][0]至a[i][3](即当前行)中最大的值。答案选择C选项。

相关考题:

若有以下函数首部int fun(double x[10], int *n)则下面针对此函数的函数声明语句中正确的是A)int fun(double x, int *n);B)int fun(double , int );C)int fun(double *x, int n);D)int fun(double *, int *);

有以下程序#include stdio.h#include stdlib.hint fun(int n){ int *p;p=(int*)malloc(sizeof(int));*p=n; return *p;}main(){ int a;a = fun(10); printf("%d\n",a+fun(10));}程序的运行结果是A)0B)10C)20D) 出错

有以下程序#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 void fun(int n) { int x(5); static int y(10); if(n>0) { 阅读下面程序:include<iostream.h>void fun(int n){int x(5);static int y(10);if(n>0){++x;++y;cout<<x<<","<<y<<end1;}}void main(){int m(1);fun(m);}则该程序的输出结果是______。

以下程序的输出结果是includein[fun(int n,int *s){int n,f2;if(n==0‖n==1)*s=1;else{ 以下程序的输出结果是 #include<stdio.h> in[fun(int n,int *s) {int n,f2; if(n==0‖n==1) *s=1; else {fun(n-1,f1); fun(n-2,f2); *s=f1+f2; }} void main() { int x; fun(6,x); pfintf("\n%d",x);}A.7B.13C.9D.10

有以下程序: include using namespace std; constxntN=5; int fun(char*s,char a,int 有以下程序:include <iostream>using namespace std;const xnt N=5;int fun(char *s,char a,int n){int j;*s=a;j=n;while(a<s[j])j--;return j;}int main(){char s[N+1];int k;

该程序运行的结果是( )。#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");}

以下程序的输出结果是【 】。include defineN 5 int fun(int *s,int a,int n) {int j; *s= 以下程序的输出结果是【 】。include <stdio.h>define N 5int fun(int *s,int a,int n){ int j;*s=a j=n;while(a!=s[j]) j-;return j;main(){ int s[N+1]; int k:for(k=1 ;k<=N;k++) s[k]=k+1:print f("%d\n",fun(s,4,N));}

阅读下列程序: include void fun(int n) { int x(5); static int y(10); if(n>0) { 阅读下列程序:include<iostream.h>void fun(int n){int x(5);static int y(10);if(n>0){++x;++y;cout<<x<<","<<y<<endl;}}void main()int m(1);fun(m);}则该程序的输出结果是______。

有以下程序 include int fun(char s[]) { int n=O; whil 有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; while(*s<='9'*s>='0') { n=10*n+*s-'0'; s++; } return (n); } main() { char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'}; printf("%d\n",fun(s)); }A.9B.61490C.61D.5

有以下程序:include int fun(int n){if(n == 1) return 1;else return( n + fun( n - 有以下程序:#include <stdio.h>int fun(int n){ if(n == 1) return 1; else return( n + fun( n - 1 ) );}main( ){ int x; seanf("% d" ,X) ;x = fun(x) ;pfinff( "% d \n" ,x);} 执行程序时,给变量x输入10,程序的输出结果是( )。A.55B.54C.65D.45

有以下程序 include void fun(int n, int *p) { int f1,t2; if(n==1 | 有以下程序 #include <stdio.h> void fun(int n, int *p) { int f1,t2; if(n==1 ||n==2) *p=1; else { fun(n-1,f1); fun(n-2,f2); *p=f1+f2; } } main() { int s; fun(3,s); printf("%d\n", s ); }A.2B.3C.4D.5

有以下程序: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 int fun(int a, int b) { if(b==0) return a; 有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a; else return(fun(-a,-b)); } main() { printf("%d\n",fun(4,2)); } 程序的运行结果是______。A.1B.2C.3D.4

有以下程序 include include int fun(int n) {int * 有以下程序 #include <stdio.h> #include <stdlib.h> int fun(int n) {int *p; p=(int*)malloc(sizeof(int)); *p=n; return *p; } { int a; a=fun(10); printf("%d\n",a+fun(10)); } 程序的运行结果是______。A.0B.10C.20D.出错

有以下程序 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 using namespace std; int n=1; void Fun(); int 给出以下程序的执行结果【 】。include <iostream>using namespace std;int n=1;void Fun();int main (){n++;Fun ( );if (n>0){int n=5;cout<<"Block: n="<<n<< ", ";}cout<< "Main: n="<<end1;return 0;}void Fun ( ){int n=10;cout<<"Fun: n="<<n<<",";}

以下程序的输出结果是()。includeint fun(int n,int *s){ int f1,f2;if(n==0||n==1)*s= 以下程序的输出结果是( )。 #include<stdio.h> int fun(int n,int *s) { int f1,f2; if(n==0||n==1) *s=1; else { fun(n-1,f1); fun(n-2,f2); *s=f1+f2; } } void main() { int x; fun(6,x); printf("\n%d" ,x);}A.7B.13C.9D.10

以下程序的输出是【】。 include using namespace std; fun(intm) { static int n=1; n=m 以下程序的输出是【 】。include<iostream>using namespace std;fun(intm){static int n=1;n=m*n;return(n);}void main(){int i;for(i=1;i<=3;i++) cout<<fun(i);}

以下程序的输出结果是#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 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 int fun ( int a[ ],int n){int result=1;for(int 下面程序的运行结果是 #include < iostream.h > int fun ( int a[ ],int n) { int result=1; for(int i=1;i<n;i++) result=result*a[i]; return result; } void main( ) { int a[3]={3,4,5}; cout << fun(a,A.12B.15C.20D.60

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

单选题若有以下程序#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,

单选题有以下程序:#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 #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 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 b[]){ int i; for(i=0;iA12,-3,0,0,B-3,-1,1,3,C0,1,2,3,D-3,-3,-3,-3,