有以下程序 #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[]={"bcc
A.xy,aaaacc
B.aaaacc,xy
C.bcc,aabcc
D.aabcc,bcc
第1题:
有如下程序段#include "stdio.h"#include "string.h"#define N 10#define M 10char *find(char(*a)[M],int n){ char *q;int i; q=a[0]; for(i=0;i<n;i++) if(strcmp(a[i],q)<0)q=a[i]; return q;}main(){ char s[N][M]={"tomeetme","you","and","he","china"}; char *p; int n=5; p=find(s,n); puts(p);}则执行后输出的结果为A.he B.and C.you D.tomeetme
第2题:
有以下程序: #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
第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[]={"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
第5题:
有下列程序: #include<stdi0.h> #include"string.h" voidfun(char*s[],intn) { char*t;inti,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;} } voidmain( ) { char*ss[]=("bcc","bbcc","xy","aaaacc","aab— cc"}; fun(ss,5);printf("%s,%s\n",ss[O],ss[4]);} 程序的运行结果是( )。
A.xy,aaaacc
B.aaaacc,xy
C.bcc,aabcc
D.aabcc,bcc