#include<stdio.h> typedef struct abc {int a,b,c; }; main() {struct abe s[2]={{1,2,3),{4,5,6}}; int t=-s[

admin2010-04-24  23

问题 #include<stdio.h>
   typedef struct abc
   {int a,b,c;
   };
   main()
   {struct abe s[2]={{1,2,3),{4,5,6}};
   int t=-s[0].a+s[1].b;
   printf("%d\n",t);
   }

选项

答案4

解析 #include<stdio.h>
   typedef struct abc{
   int a,b,C;
   };/*定义一个结构体类型*/
   main()
   {struct abc s[2]={{1,2,3},{4,5,6}};/*定义一个结构体数组s[2]并赋初值*/
   int t=-s[0].a+s[1].b;/*引用结构体数组元素的成员进行计算,计算t的值*/
   printf("%d\n",t);
   }
转载请注明原文地址:https://kaotiyun.com/show/1xAx777K
0

相关试题推荐
最新回复(0)