#include <iostream>
using namespace std;
#define NULL 0     
struct student
{long num;
 float score;
 student *next;
};    
int n;     
student *del(student *head,long num)
{student *p1,*p2;
 if (head==NULL)                    //ǿձ
 {cout<<"list null!"<<endl; return(head);}
 p1=head;                          //ʹp1ָһ
 while(num!=p1->num && p1->next!=NULL) //p1ָĲҪҵĽҺ滹н
 {p2=p1; p1=p1->next;}                 //p1һ
 if(num==p1->num)                        //ҵ
 {if(p1==head) head=p1->next;   //p1ָ׽㣬ѵڶַhead
  else p2->next=p1->next;    //һַǰһַ
  cout<<"delete:"<<num<<endl;
  n=n+1;
 }
 else cout<<"cannot find "<<num;     //Ҳý
 return(head);
}
