有以下程序 #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
A.0987654321
B.4321098765
C.5678901234
D.0987651234
第1题:
有下列程序: #include<stdi0.h> voidfun(int*S,intn1,intn2) { inti,j,t; i=n1;j=n2 while(i<j){t=s[i];s[i]=s[j];s[j]=t;i++;j --;} } voidmain( ) { 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<10;k++)printf(”%d”,a[k]);printf ("\n"); } 程序的运行结果是( )。
A.0987654321
B.4321098765
C.5678901234
D.0987651234
第2题:
有以下程序
#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<l0;k++)printf("%d",a[k]); printf("\n");
}
程序的运行结果是
A.0987654321
B.4321098765
C.5678901234
D.0987651234
第3题:
有以下程序 #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,aaaacc
B.aaaacc,xy
C.bcc,aabcc
D.aabcc,bcc
第4题:
有以下程序: #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,aaaacc
B.aaaacc,xy
C.bcc,aabcc
D.aabcc,bcc
第5题:
有以下程序 #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.987654321
B.4321098765
C.5678901234
D.987651234