问题 单项选择题

下列程序的输出结果是( )。
#include <stdio.h>
struct abc
int a, b, c, s;;
main()
struct abc s[2]=1,2,3,4,5,6;
int t;
t=s[0].a+s[1].b;
printf("%d\n",t);

A.5

B.6

C.7

D.8

答案

参考答案:B

解析: 在本题中,s[0].a=1,s[1].b=5,所以输出结果为6。

多项选择题
单项选择题