网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序

#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


参考答案

更多 “ 有以下程序#include stdio.hvoid fun(int *s,int n1,int n2){ int i,j,t;i=n1; 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;kl0;k++)printf("%d",a[k]); printf("\n");}程序的运行结果是A.0987654321B.4321098765C.5678901234D.0987651234 ” 相关考题
考题 ●试题四阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。【说明】函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。【函数】void QuickSort(int A[],int s,int t){int i=s,j=t+1,temp;int x=A[s];do{do i++;while (1) ;do j--;while(A[j]x);if(ij){temp=A[i]; (2) ; (3) ;}}while(ij);A[a]=A[j];A[j]=x;if(si-1) (4) ;if(j+1t) (5) ;}

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

考题 有以下程序:int f(int b[][4]){int i,j,s=0;for(j=0;i2)i=3-j;s+=b[i][j];}ret 有以下程序: int f(int b[][4]) { int i,j,s=0; for(j=0;i<4;i++) { i=j; if(i>2) i=3-j; s+=b[i][j]; } return s; } main() { int a[4][4]={{1,2,3,4,},{0,2,4,6},{3,6,9,12},{3,2,1,0}}; printf("%d\n",f(a)); } 执行后的输出结果是( )。A.12B.11C.18D.16

考题 有以下程序#include stdio.h#include string.hvoid fun(char *s[],int n){ char *t; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;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

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

考题 阅读下列函数说明和C代码,将应填入(n)处的字句写在对应栏内。【说明】函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。【函数】void QuickSort( int A[ ],int s,int t){ int i=s,j=t+1,temp;int x=A[s];do{do i ++ ;while (1);do j -- ;while(A[j]>x);if(i<j){temp=A[i];(2);(3);}}while(i<j);A[a] =A[j];A[j] =x;if(s<i-1) (4);if(j+1<t) (5);}

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

考题 以下程序的输出结果是( )。 include main() {int i=10,j=0; do {j=j+i; i--; }while(i>5 以下程序的输出结果是( )。 include<stdio.h> main() {int i=10,j=0; do {j=j+i; i--; }while(i>5); printf("%d\n",j); }

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

考题 有下列程序: 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

考题 有下列程序: #includestdi0.h voidfun(int*S,intn1,intn2) { inti,j,t; i=n1;j=n2 while(ij){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;k10;k++)printf(”%d”,a[k]);printf ("\n"); } 程序的运行结果是( )。A.0987654321B.4321098765C.5678901234D.0987651234

考题 以下程序运行后的输出结果是【】。include main(){int i=10,j=0;do{j=j+ i; i--;}while 以下程序运行后的输出结果是【 】。include <iostream.h>main(){int i=10,j=0;do{j=j+ i; i--;}while(i>2);cout<<j;}

考题 有以下程序:int f(int b[][4]){ int i, j, s=0;for(j=0j2) i=3-j;s+=b[i][j]; 有以下程序:int f(int b[][4]){ int i, j, s=0; for(j=0j<4;j++) { i=j; if(i>2) i=3-j; s+=b[i][j]; } return s;}main(){ int a[4][4]={ { 1,2,3,4}, {0,2,4,6},{3,6,9,12 }, {3,2,1,0} }; printf("%d\n", f(a)); }执行后的输出结果是( )。A.12B.11C.18D.16

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

考题 有下列程序: #includestdi0.h #include"string.h" voidfun(char*s[],intn) { char*t;inti,j for(i=0;in-1;i++) for(j=i+1;jn;j++) if(strlen(s[i]strlen(s[j])){t=s[i];s[i]=s [j];s[j]=t;} } voidmain( ) { char*ss[]=("bcc","bbcc","xy","aaaacc","aab— cc"}; fun(ss,5);printf("%s,%s\n",ss[O],ss[4]);} 程序的运行结果是( )。A.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

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

考题 有以下程序:int f(int b[][4]){int i, j, s=0;for(j=0; j2)i=3-j;S+=b[i][j]; 有以下程序: int f(int b[][4]) { int i, j, s=0; for(j=0; j<4; j++) { i=j; if(i>2)i=3-j; S+=b[i][j]; } return s; } main() { int a[4][4]={{1, 2, 3, 4}, {0, 2, 4, 6}, {3, 6, 9, 12}, {3, 2, 1, 0}}; printf("%d\n", f(a)); } 执行后的输出结果是______。A.12B.11C.18D.16

考题 写出算法的功能。intfun(sqstring*s,sqstring*t,intstart){inti=start-1,j=0;while(ilenjlen)if(s-data[i]==t-data[j]){i++;j++;}else{i=i-j+1;j=0;}if(j=t-len)returni-t-len+1;elsereturn-1;}

考题 单选题有以下程序: #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(""); } 程序运行的结果是(  )。A 0987654321B 4321098765C 5678901234D 0987651234

考题 问答题写出算法的功能。intfun(sqstring*s,sqstring*t,intstart){inti=start-1,j=0;while(ilenjlen)if(s-data[i]==t-data[j]){i++;j++;}else{i=i-j+1;j=0;}if(j=t-len)returni-t-len+1;elsereturn-1;}

考题 单选题有以下程序:#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]);}程序的运行结果是(  )。A xy,aaaaccB aaaacc,xyC bcc,aabccD aabcc,bcc

考题 单选题有以下程序: #include voidfun(int*s,intn1,intn2) {  inti,j,t;  i=n1;  j=n2;  while(i A 5678901234B 0987654321C 4321098765D 0987651234

考题 单选题有以下程序:#includevoid fun(int *x,int s, int e){ int i,j,t; for(i=s,j=e;i A 4567890123B 3210987654C 9876543210D 0987651234