struct student
{
long num;
float score;
stuent *next;
};
student *creat (void)
{
student *head;
student *p1=null,*p2=null;
int n=0;
p1=p2=new student;
cin>>p1->num>>p1->score;
head=null;
while(p1->num !=0)
{
n=n+1;
if(1==n) head=p1;
else
p2->next=p1;
p2=p1;
p1= new student;
cin>>p1->mum>>p1->score;
}
p2->next =NULL;
return (head);
}
网友评论