有以下程序:
#include
#include
typedef struct { char name[9]; char sex; int score[2]; } STU;
STU f (STU a)
{ STU b={"Zhao", 'm', 85, 90};
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, 92 }, d;
d = f(c);
printf ("%s,%c,%d,%d, ", d.name, d.sex, d.score[0], d.score[1]);
printf ("%s,%c,%d,%d\n", c.name, c.sex, c.score[0], c.score[1]);
}
程序运行后的输出结果是( )。
- A.Zhao,m,85,90, Qian,f,95,92
- B.Zhao,m,85,90, Zhao,m,85,90
- C.Qian,f,95,92, Qian,f,95,92
- D.Qian,f,95,92, Zhao,m,85,90
热度🔥646
解析:打开微信小程序查看本题解析