#include <stdio.h>
#include <string.h>
typedef struct{ char name[9];char sex; float score[2]; } STU;
STU f(STU a)
{ 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[i]=b.score[i];
return a;
}
main()
{ STU c={"Qian",'f',95.0,92.0},d;
d=f(c); printf("%s,%c,%2.0f,%2.0f/n",d.name,d.sex,d.score[0],d.score[1]);
}
程序的运行结果是
A.)Qian,f,95,92
B.)Qian,m,85,90
C.)Zhao,m,85,90
D.)Zhao,f,95,92
[单选题]有以下程序#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[
[单选题]有以下程序#include <stdio.h>#include <string.h>main(){ char str[ ][20]={"One*World","One*Dream!"},*p=str[1];printf("%d,",strlen(p));printf("%s/n",p);}程序运行后的输出结果是A.)9,One*WorldB.)9,One*Dream !C.)10,One*Dream !D.)10,One*World
[单选题]有以下程序#include <stdio.h>#include <string.h>main(){ char a[10]="abcd";printf("%d,%d/n",strlen(a),sizeof(a));}程序运行后的输出结果是A.)7,4B.)4,10C.)8,8D.)10,10
[单选题]有以下程序#include <stdio.h>#include <string.h>main( ){ printf("%d/n",strlen ("ATS/n012/1") ); }程序运行后的输出结果是A.)3B.)8C.)4D.)9
[单选题]有以下程序#include <stdio.h>#include <string.h>typedef struct{ char name[9]; char sex; float score[2]; }STU;void f(STU a){ STU b={"Zhao",′m′,850,900}; int i;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i<2;i++) a.score[i]=b.score[i];}main(){
[单选题]有以下程序#include <stdio.h>#include <string.h>typedef struct{ char name[9]; char sex; float score[2]; }STU;void f(STU a){ STU b={"Zhao",′m′,850,900}; int i;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i<2;i++) a.score[i]=b.score[i];}main(){
[单选题]有以下程序#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","a
[单选题]有以下程序#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","a
[单选题]有以下程序#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
[单选题]有以下程序#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