#include
#include
#include
#include
#include
#define len sizeof(struct student)
#define N 3
struct student
{
char name[20];
int age;
char sex[6];
float score;
struct student *next;
};
void main()
{
int i=1;
struct student *head,*p1,*p2;
head=NULL;
p1=p2=(struct student *)malloc(len);
while(i<=N)
{
gets(p2->name);
scanf("%d %s %f",&p2->age,&p2->sex ,&p2->score );
if(i==1)
head=p1;
else
p1->next=p2;
p1=p2;
p2=(struct student *)malloc(len);
i=i+1;
getchar();
}
p1->next=NULL;
}