#include <stdio.h>
struct
student
{
int
num;
char
name[20];
char
sex;
int
age;
float
score;
};
struct
student stu[3]={
{11302,
"Wang"
,
'F'
,20,486.69},
{11303,
"Zhao"
,
'F'
,25,466.59},
{11304,
"Xue"
,
'M'
,26,483.59}
};
main()
{
struct
student student1={11305,
"Li"
,
'F'
,19,59.59};
struct
student *p,*q;
int
i;
p=&student1;
printf
(
"%s,%c,%f\n"
,student1.name,(*p).sex,p->score);
q=stu;
for
(i=0;i<3;i++,q++)
{
printf
(
"%s,%c,%f\n"
,q->name,(*q).sex,stu[i].score);
}
}