网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有以下程序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.987654321
B.4321098765
C.5678901234
D.987651234
参考答案
更多 “ 有以下程序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 ” 相关考题
考题
有以下程序#include stdio.h#include string.hvoid fun(char s[][10],int n){ char t;int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)/* 比较字符串的首字符大小,并交换字符串的首字符 */if (s[i][0] s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){ char ss[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
考题
有以下程序#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
考题
有下列程序: include include "string.h" void tim(char *s[],int n)
有下列程序: #include <stdio.h> #include "string.h" void tim(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 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
考题
阅读下列函数说明和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);}
考题
有以下程序:include void f(int a[],int i, int j){int t; if(i
有以下程序: #include <stdio.h> void f(int a[],int i, int j) { int t; if(i<j) { t=a[i];a[i]=a[j];a[j]=t; f(a,i+1,j-1); } } main() { int i,aa[5]={1,2,3,4,5}; f(aa,0,4); for(i=0;i<5;i++) printf("%d,",aa[i]);printf("\n"); } 执行后的输出结果是( )。A.5,4,3,2,1,B.5,2,3,4,1,C.1,2,3,4,5,D.1,5,4,3,2,
考题
下列给定程序中,函数fun()的功能是:读入一个字符串 (长度<20),将该字符串中的所有字符按ASCII码降序排序后输出。例如:输入dafhc,则应输出hfdca。请改正程序中的错误,使它能得到正确结果。注意:不要改动main函数,不得增行或删行,敢不得更改程序的结构。试题程序:include <conio.h>include <stdio.h>/*************found**************/int fun(char t[]){char c;int i,j;for(i=0;i<strlen(t)-1;i++)for(j=i+1;i<strlen(t);j++)if(t[i]<t[j]){c=t[j];/*************found**************/t[i]=t[i++];t[i]=c;}}main(){char s[81];clrscr();printf("\nPlease enter a characterstring:");gets(s);printf("\n\nBefore sorting:\n%S",s);fun(s);printf("\nAfter sorting decendingly:\n%s",s);}
考题
以下程序的输出结果是______。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);
考题
已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f
已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。
考题
有以下程序 include include void fun(char s[][10],int n
有以下程序 #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 0--i+l; j<n; j++) /*比较字符串的首字符大小,并交换字符串的首字符*/ if(s[i][0] > s[j][0]) { t = s[i][0]; s[i][0] = s[j][0]; s[j][0] = t;} } main() { char ss[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
考题
有以下程序: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 int f(int b[] [4]){int i,j,s=0; for(j=0;j2)
有以下程序: #include <stdio.h> 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
考题
有以下程序: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
考题
下面程序的运行结果是includemain(){char a[]="morning",t; int i,j=0; for(i=1;i
下面程序的运行结果是 #include<stdio.h> main() { char a[]="morning",t; int i,j=0; for(i=1;i<7;i++) if(a[j]<a[i])j=i; t=a[j]; a[j]=a[7]; a[7]=a[j]; puts[a];}A.mrgninrB.moC.moringD.morning
考题
有下列程序: 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
考题
有以下程序: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
考题
有以下程序:include struct STU{char name[10]; int num; int Score;};main(){struct
有以下程序: #include <stdio.h> struct STU { char name[10]; int num; int Score; }; main() { struct STU s[5]={{"YangSan",20041,703},{"LiSiGuo",20042,580}, {"WangYin",20043,680},{"SunDan",20044,550}, {"Penghua",20045,537}}, *p[5],*t; int i,j; for(i=0;i<5;i++) p[i]=s[i]; for(i=0;i<4;i++) for(j=i+1;j<5;j++) if(p[i]->Score>p[j]->Score) { t=p[i];p[i]=p[j];p[j]=t;} printf("%d%d\n",s[1].Score,p[1]->Score); } 执行后的输出结果是( )。A.550 550B.680 680C.580 550D.580 680
考题
有以下程序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
考题
单选题有以下程序: #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
考题
单选题有以下程序:#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
热门标签
最新试卷