有以下程序#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 <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#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 void swap(int *a, int *b){ int *t;}{ int i=3,j 以下程序的输出结果是______。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);

有以下程序 include void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() {int x=3 有以下程序 #include<stdio.h> void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() { int x=3, y=5,*p=x, *q=y; fun(p,q); printf("%d,%d,",*p,*q); fun(x,y); printf(" %d,%d\n",*p,*q); } 程序运行后的输出结果是______。A.3,5,5,3B.3,5,3,5C.5,3,3,5D.5,3,5,3

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

有以下程序: #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 void fun(int*A) {a[0]=a[1];} main() {i 有以下程序,程序执行后,输出结果是【 】include<stdio.h>void fun(int*A){ a[0]=a[1];}main(){ int a[10]={10,9,8,7,6,5,4,3,2,1,},i;for(i=2;i>1=0;i-) fun(a[i]);for(i=0;i<10;i++) printf("%d,a[i]);printf("\n");}

有以下程序: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 "stdio.h"int *fun(int *a,int *b){ int m; m=*a; m+=*b-3; return(m);}main(){ int x=21,y=35,*a=x,*b=y; int *k; k=fun(a,b); printf("%d\n",*k);}

有以下程序:includevoid fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3, 有以下程序: #include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,B) ; printf("%d\n",*b+1); } 程序的输出结果是( )A.2B.3C.4D.5

以下程序的输出结果是()。includeint fan(int);main(){int w=5; fun(w);printf("\n");} 以下程序的输出结果是( )。 #include <stdio.h> int fan(int); main() { int w=5; fun(w); printf("\n"); } fun(int k) { if(k>0) fun(k-1); printf("%d",k); }A.5 4 3 2 1B.0 1 2 3 4 5C.1 2 3 4 5D.5 4 3 2 1 0