4,
#include <stdio.h>
typedef struct student
{
int a;
int b;
int c;
}XS; //XS==struct student 所以定义变量可以是 XS t11; struct student t12; // t111==t12;
typedef struct
{
int a;
int b;
int c;
}XSS;
int main()
{
XS t1={
.a=2,
.b=5,
.c=18,
};
struct student t2={
.a=61,
.b=63,
.c=168,
};
XSS t3={
.a=5,
.b=7,
.c=198,
};
printf("a=%5d b=%5d c=%5d \n",t1.a,t1.b,t1.c);
printf("a=%5d b=%5d c=%5d \n",t2.a,t2.b,t2.c);
printf("a=%5d b=%5d c=%5d \n",t3.a,t3.b,t3.c);
return 0;
}
运行的结果