下列程序的输出结果是( )。 #include <stdio.h> struct abc { int a, b, c, s;}; main() { struct abc s[2]={{1,2,3},{4,5,6}}

admin2009-01-15  27

问题 下列程序的输出结果是(    )。    #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

答案2

解析 在本题中,s[0].a=1,s[1].b=5,所以输出结果为6。
转载请注明原文地址:https://kaotiyun.com/show/QUXp777K
0

最新回复(0)