第2个回答 2010-07-31
int Search(LIST& head,int str){
LIST p,q;
p=head;
if(head==NULL)
cout<<"list NULL,erro\n";
else{
for(;p->data!=str&&p->next!=NULL;p=p->next)
q=p;
if(p->next==NULL&&p->data!=str)
cout<<str<<" is not in the list\n";
else if(p->data==str)
return(str);
}
}