#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];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,aaaacc
B.aaaacc,xy
C.xcc,aabcc
D.acc,xabcc
[单选题]有以下程序#include<stdio.h>#include<string.h>typedef struct {char name[9]; char sex; float score[2];}STU;STU f(STUA.{STU b={“Zhao”,’m’,85.0,90.0}; int I;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i<2;i++) a.score=b.score;return a;}main(){STU
[单选题]有以下程序:include<stdio.h> include<string.h>main{ char x[]="STRING"有以下程序:include<stdio.h>include<string.h>main{ char x[]="STRING";x[0]=0;x[1]=/0;x[2]=0;printf("%d %d/n",sizeof(x),strlen(x));}程序运行后的输出结果
[单选题]有以下程序#include<stdio.h>#include<string.h>struet A{int a;char b[10];double c;};struct A f(struct A t);main( ){struct A a={1001,“ZhangDa”,1098.0);a=f(A);prinff(“%d,%S,%6.1f\n”,a.a,a.b,a.e);}struct A f(struct A t){t.a=1002;strepy(t.b,“changRo
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char a[10]=”abcd”;prinff(“%d,%d\n”,strlen(A),sizeof(A));}程序运行后的输出结果是A.7,4B.4,10C.8,8D.10,lO
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char str[][20]={“Qne*World”,“one*Dream!”},*P=str[1 ].prinff(“%d,”,strlen(p));printf(“%s\n”,P); ’}程序运行后的输出结果是A.9,One*World S)9,One*Dream!B.10,One*Dream!C.10,One*World
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char x[]=“STRING”;x[0]=0;x[1]=’\0’;x[2]=’0’;printf(”%d%d\n”,sizeof(x),strlen(x));}程序运行后的输出结果是( )。A.6 1B.7 0C.6 3D.7 1
[单选题]有以下程序#include<stdio.h>#include<string.h>void fun(char *w,int m){ char s,*p1,*p2;p1=w;p2=w+m-1;while(p1<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}}main(){ char a[]="123456";fun(a,strlen(a));puts(a);}程序运行后的输出结果是A.654321B.116611C.161616D.12345
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char x[]=“STRING”;x[0]=0;x[1]=’\0’;x[2]=’0’;printf(”%d%d\n”,sizeof(x),strlen(x));}程序运行后的输出结果是( )。A.6 1B.7 0C.6 3D.7 1
[单选题]有以下程序#include<stdio.h>#include<string.h>struet A{int a;char b[10];double c;};struct A f(struct A t);main( ){struct A a={1001,“ZhangDa”,1098.0);a=f(A);prinff(“%d,%S,%6.1f\n”,a.a,a.b,a.e);}struct A f(struct A t){t.a=1002;strepy(t.b,“changRo
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char str[][20]={“Qne*World”,“one*Dream!”},*P=str[1 ].prinff(“%d,”,strlen(p));printf(“%s\n”,P); ’}程序运行后的输出结果是A.9,One*World S)B.9,One*Dream!C.10,One*Dream!D.10,One*World