struct student *sort(struct student *head)
{
struct student *p1,*p2,*p3;
int i,j;
for(i=1;i<n;i++)
{
p2=p3=head;
for(j=0;j<n-i;j++)
{
p1=p2->next;
if (strcmp(p2->num,p1->num)>0)
{
p2->next=p1->next;
p1->next=p2;
if(p2==head)
{
head=p1;
p3=p1;
}
else
{
p3->next=p1;
p3=p1;
}
}
else
{
p3=p2;
p2=p2->next;
p1=p1->next;
}
}
}
return(head);