求c++程序题答案:输出的第一和第二个数据是什么?原理是什么?谢谢
#includetypedefstructstudent{charname[10];longsno;floatscore;}STU;main(){STUa={“zhang...
# include
typedef struct student{
char name[10];
long sno;
float score;
}STU;
main( )
{ STU
a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},c={“Anhua”,2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf(“%ld%s\n”,d.sno,p->name);
} 展开
typedef struct student{
char name[10];
long sno;
float score;
}STU;
main( )
{ STU
a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},c={“Anhua”,2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf(“%ld%s\n”,d.sno,p->name);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询