void upside_down(link h)
{
link p,q;
p=h->next;
h->next=NULL;
while(p!=NULL)
{
q=p;
p=p->next;
q->next=h->next;
h->next=q;
}
}
void upside_down(link h)
{
link p,q;
p=h->next;
h->next=NULL;
while(p!=NULL)
{
q=p;
p=p->next;
q->next=h->next;
h->next=q;
}
}