题目内容

以下程序段的运行结果是( )。struct Player {int id; float h,w; };struct Player a={1601,182.5,75};struct Player b={1602,185.5,72.5};if(a.w>b.w) printf("%d\n",a.id);else printf("%d\n",b.id);

A. 182.5
B. 1601
C. 1602
D. 185.5

查看答案
更多问题

以下程序段的运行结果是( )。struct M {int id; int length; };struct M a={101,156};struct M b={102,167};struct M c={103,160};int i;i=a.length+b.length-c.length;printf("%d\n",i);

A. 163
B. 171
C. 169
D. 327

若有以下定义,能正确输出letter成员值为'D'的语句是( )。struct Table {int id; char letter; };struct Table a[5]={{1,'A'},{2,'B'},{3,'C'},{4,'D'},{5,'E'}};

A. printf("%c\n",a[3].letter);
B. printf("%c\n",a.letter);
C. printf("%c\n",letter);
D. printf("%c\n",a.letter[3]);

若已定义:struct st { int num; struct ym { int y; int m; }birthym; }st1;下列能对结构变量st1的成员y进行正确赋值的是( )。

A. st.birthym.y=1998;
B. st1.struct ym.y=1998;
C. st1.birthym.y=1998;
D. birthym.y=1998;

若有以下定义,能输出字母'G'的语句是( )。struct stu { char name[9]; int age;};struct stu s[5]={"Zheng",16,"Lin",18,"Yang",19,"Guo",20};

A. printf("%c\n",s[3].name[0]);
B. printf("%c\n",s[4].name[0]);
C. printf("%c\n",struct.name[0]);
D. printf("%c\n",name[4][0]);

答案查题题库