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

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

有以下程序: 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[i]=t; } printf("%d %d\n",s[1].Score,p[1]->Score); } 执行后输出结果是( )。

A.550 550

B.680 680

C.580 550

D.580 680


参考答案

更多 “ 有以下程序: 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[i]=t; } printf("%d %d\n",s[1].Score,p[1]->Score); } 执行后输出结果是( )。A.550 550B.680 680C.580 550D.580 680 ” 相关考题
考题 有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 有以下程序 struct STU { char name[10]; int num; float TotalScore; }; vold f(struct STU *p) { struct STU s[2]={{"SunDan",20044,550),{"Penghua".20045,537}},*q=s ++p; ++q; *p=*q; } main() { struct SrU s[3]={{"YangSan",20041,703),{"LiSiGuo",20042,580}}; f(s); printf("%s %d %3.of\n",S[1].name,s[1].num,s[1].Totalscore); } 程序运行后的输出结果是A.SunDan 20044 550B.Penghua 20045 537C.USiGuo 20042 580D.SunDan 20041 703

考题 有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (b); printf ( "%d %d\n" ,a.num,b.num); } 执行后输出结果是A.2041 2044B.2041 2043C.2042 2044D.2042 2043

考题 有以下程序: struct STU { char name[10]; int num; float TotalScore; }; void f(struct STU *p) { struct STU s[2]={{"SunDan", 20044, 550}, {"Penghua", 20045, 537}}, *q=s; ++p; ++q; *p=*q; } main() { struct STU s[3]={{"YangSan", 20041, 703}, {"LiSiGuo", 20042, 580}}; f(s); printf(" % s % d % 3.0f\n", s[1]. name, s[1]. num, s[1]. TotalScore); } 程序运行后的输出结果是______。A.SunDan 20044 580B.Penghua 20045 537C.LiSiGUO 20042 580D.SunDan 20041 703

考题 有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 有以下程序: struct STU {char name[10];int num;float TotalScore;}; void f(struct STU *p) {struct STU s[2]={{"SunDan",20044,550},{"Penghua",20045,537}},*q=s; ++p;++q; *p=*q; } main() {struct STU s[3]={{"YangSan",20041,703},{"LiSiGuo",20042,580}}; f(s); printf("%s%d%3.0f\n",s[1].name,s[1].num,s[1].TotalScore); } 程序运行后的输出结果是 ______。A.SunDan 20044 550B.Penghua 20045 537C.LiSiGuo 20042 580D.SunDan 20041 703

考题 有以下程序: struct STU{ char name[10]; int num; }; void f1(struct STU c) { struct STU b={"LiSiGuo",2042); c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main() {struct STU a={"YangSan",2041},b={"WangYin",2043); f1(a);f2(b); printf("%d %d\n",a.num,b.num); } 执行后输出结果是( )。A.2041 2044B.2041 2043C.2042 2044D.2042 2043

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

考题 有以下程序:includeinclude struct STU {char name[10];int hum;};void f( 有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 有以下程序:includevoid fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3, 有以下程序: #include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,B) ; printf("%d\n",*b+1); } 程序的输出结果是( )A.2B.3C.4D.5