有以下程序: void fun(int *a,int i,int j) { int t; if(i<j) { t=a[i];a[i]=a[j];a[j]=t; i++; j--; fun(a,ij); } } 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.1 2 6 8B.8 6 2 1C.8 1 6 2D.8 6 1 2

有以下程序: void fun(int *a,int i,int j) { int t; if(i<j) { t=a[i];a[i]=a[j];a[j]=t; i++; j--; fun(a,ij); } } 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.1 2 6 8

B.8 6 2 1

C.8 1 6 2

D.8 6 1 2


相关考题:

有以下程序#include stdio.hvoid fun(int *s,int nl,int n2){ int i,j,t;i=nl; j=n2;while(ij) {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,4,9); fun(a,0,9);for(k=0;k10;k++)printf("%d",a[k]); printf("\n");}程序运行的结果是 ( )A)0987654321B)4321098765C)5678901234D)0987651234

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

有以下程序:includeincludevoid fun(char s[][10],int n){char t;int i,j; 有以下程序: #include<stdio.h> #include<string.h> void fun(char s[][10],int n) { char t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0]>s[j][0]){t=s[i][0];s[i][0]=s[j][0];sEj][0]=t;} } main() {char s[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"); fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.xcc,aabccD.acc,xabcc

有以下程序 void fun(int*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.1 2 6 8B.8 6 2 1C.8 1 6 2D.8 6 1 2

有以下程序: void fun(int a*a,int i,int i) {int t; if(i<j); {t=a[i];a[i]=a[j];a[j]=t; fun(a,++i,--j); } } main() {inta[]={1,2,3,4,5,6},i; fun(a,0,5); for(i=0;i(6;i++) cout<(a[i]; } 执行后输出结果是( )。A.6 5 4 3 2 1B.4 3 2 1 5 6C.4 5 6 1 2 3D.1 2 3 4 5 6

有以下程序: void fun(int *a,int i,int i) { int t; if(i<j) { t==a[i];a[i]=a[j];a[i]=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)/* fun 函数的功能是将a所指数 有以下程序 #include <stdio.h> void fun(int *a, int n)/* fun 函数的功能是将a所指数组元素从大到小排序*/ { int t, i,j; for (i=0; i<n-1 ;i++) for 0=i+l; j<n; j++) if(a[i]<a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } main() { int c[10]= { 1,2,3,4,5,6,7,8,9,0},i; fun(c+4, 6); for (i=0;i<10; i++) printf("%d,", c[i]); printf("\n"); }A.1,2,3,4,5,6,7,8,9,0,B.0,9,8,7,6,5,1,2,3,4,C.0,9,8,7,6,5,4,3,2,1,D.1,2,3,4,9,8,7,6,5,0,

有以下程序:includeincludevoid fun(char*s[],int n){char*t;int i,j;for( 有以下程序: #include<stdio.h> #include<string.h> void fun(char*s[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])){t=s[i];s[i]=s[j];s[j]=t;} } main() { Char*ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

有以下程序includeincludevoidfun(char*s[],intn){char*t;int i,j;for(i=0 有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bccA.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

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

以下程序的输出结果是( )。 void fun(int*a,int i,int i) {int t; if(ii) { t=a[i[;a[i]=a[j];a[j]一t; i++;j--;fun(a,i,j); } } main { int K[]={2,6,1,8},i; fun(x,0,3); for(i=0;i1;i++)printf("%2d",x[i]); printf("\n"); }A.1,2,6,8B.8,6,2,1C.8,1,6,2D.8,6,1,2

有以下程序 void fun{int *a,int i,int j) { int t; if (i<j) t=a[i] ;a[i]=a[j] ;a[j]=t; fun(a, ++i, --j); } main ( ) { int a[]={1,2,3,4,5,6},i; fun(a,0,5); for (i=0; i<6; i++ ) printf ("%d" , a [i] ); } 执行后输出结果是A.6 5 4 3 2 1B.4 3 2 1 5 6C.4 5 6 1 2 3D.1 2 3 4 5 6

有下列程序: include void fun(int * s,int n1,int n2) { int i,j, 有下列程序: #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,4,9);fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]);printf("\n"); } 程序的运行结果是( )。A.987654321B.4321098765C.5678901234D.987651234

有以下程序 void fun(int *a,int i,int j) { in t; if(i<j) {t=a[i];a[i]=a[j];a[j]=t; fun(a,++i,--j); } } main() { int a[]={1,2,3,4,5,6},i; fun(a,0,5); for(i=0;i<6;i++) printf("%d",a[i]); } 执行后输出结果是A.6 5 4 3 2 1B.4 3 2 1 5 6C.4 5 6 1 2 3D.1 2 3 4 5 6

有以下程序void fun(int* a, int i, int j){ int t; if(i<j); { t =a[i] ;a[i]= a[j] ;a[i]= t; fun(a, ++i, --j);}}main(){ int a[i]={1,2,3,4,5,6}, i; fun(a,0,5); for(i=0;i<6; i++) cout<<a[i];}执行后输出结果是A.654321B.432156C.456123D.123456

有以下程序: void fun( int *a, int i, int j) { int t; if ( i<j ) { t=a[i];a[i]=a[j];a[j]=t; fun (a,++i,--j); } } main() { int a[]={1,2,3,4,5,6),i; fun(a,0,5) for( i=0; i<6; i++) printf("%d",a[i]); } 执行后的输出结果是( )。A.654321B.432156C.456123D.123456

有以下程序:includeinclude"string.h"void fun(char*s[],int n){char*t;int i,j;for( 有以下程序: #include<stdio.h> #include"string.h" void fun(char*s[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])){t=s[i];s[i]=s[j];s[j]=t;} } main() { char*ss[]={"bee","bbcc","xy","aaaacc","aabcc"}; fun(ss,5);printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

有以下程序:include using namespace std;void fun(int i,int j){ cout 有以下程序: #include <iostream> using namespace std; void fun(int i,int j) { cout<<(i+j)<<end1; } void fun(int i) { cout<<i++<<end1; } int main() { int a=1; fun(A) ; return 0; } 该程序执行后的输出结果是( )。A.1B.2C.3D.4

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

有以下程序 include void fun(int *a,int n)/*fun函数的功能是将a所指数组元素从大到 有以下程序#include <stdio.h>void fun(int *a,int n)/*fun函数的功能是将a所指数组元素从大到小排序*/{ int t,i,j;for(i=0;i<n-1;j++)for(j=i+1;j<n;j++)if(a[i]<a[j]) { t=a[i];a[i]=a[j];a[j]=t;}}main( ){ int c[10]={1,2,3,4,5,6,7,8,9,0},i;fun(c+4,6);for(i=0;i<10;i++) printf("%d,",c[i]);printf("\n");}程序的运行结果是A.1,2,3,4,5,6,7,8,9,0,B.0,9,8,7,6,5,1,2,3,4,C.0,9,8,7,6,5,4,3,2,1,D.1,2,3,4,9,8,7,6,5,0,

有以下程序 void fun(int *a,int i,int j) { int t; if (i<j) { t=a[j]; 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]); } 程序运行后的输出结果是______。A.1 2 6 8B.8 6 2 1C.8 1 6 2D.8 6 1 2

有以下程序void fun(intā*a,int i,int i){ int t;if(i<j);{ t=a[i];a[i]=a[j];a[j]=t;fun(a,++i,- -j);}}main( ){ int a[]={1,2,3,4,5,6},i;fun(a,0,5);for(i=0;i<6;i++)cout<<a[i];}执行后输出结果是A.6 5 4 3 2 1B.4 3 2 1 5 6C.4 5 6 1 2 3D.1 2 3 4 5 6

有以下程序includevoidfun(int*s,intn1,intn2){inti,j,t; i=n1j=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,4,9); fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]); printf("\n"); } 程序的运行结果是A.987654321B.4321098765C.5678901234D.987651234

有以下程序includeincludevoidfun(char,*s[],intn){char*t;inti,j; for(i= 有以下程序 #include <stdio.h> #include <string.h> void fun(char,*s[],int n) { char *t; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i]:s[j];s[j]=t;} } main() { char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s\n",ss[0],ss[4]); } 程序的运行结果是A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

以下程序中,fun函数的功能足求3行4列二维数组每行尢素中的最大值。请填空。 void fun(int,int,int(*)[4],int*); main() {int a[3][4]={{12,41,36,28},{19,33,15,27},{3,27,19,1}},b[3],i; fun(3,4,a,B); for(i=0;j<3;i++)printf("%4d",b[i]); printf("\n"); } void fun(int m,int n,int ar[][4],int*br) {int i,j,x; for(i=0;i<m;i++) {x=ar[i][0]; for(j=0;j<n;j++) if(( )) x=ar[i][j]; br[i]=x; } }

单选题有以下程序: #include voidfun(int*s,intn1,intn2) {  inti,j,t;  i=n1;  j=n2;  while(i  {   t=s[i];   s[i]=s[j];   s[j]=t;   i++;   j--;  } } main() {  inta[10]={1,2,3,4,5,6,7,8,9,0},k;  fun(a,0,3);  fun(a,4,9);  fun(a,0,9);  for(k=0;k   printf("%d",a[k]);  printf(""); } 程序运行的结果是(  )。A0987654321B4321098765C5678901234D0987651234

单选题有以下程序:#include #include void fun(char *s[],int n){ char *t; int i,j; for(i=0;i  for(j=i+1;j   if(strlen(s[i])strlen(s[j]))   {    t=s[i];    s[i]=s[j];    s[j]=t;   }}main(){ char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"}; fun(ss,5); printf("%s,%s",ss[0],ss[4]);}程序的运行结果是(  )。Axy,aaaaccBaaaacc,xyCbcc,aabccDaabcc,bcc