需求分析 功能描述 总体设计
else for(;temp->next!=NULL;temp=temp->next) {if(strcmp(temp->next->outname(),n)==0)
{p=temp->next;temp->next=temp->next->next;delete p; cout<<"\n删除成功\n";return 0;}}
cout<<"\n查无此人,删除失败\n"; return 0; }
int list::delstu1(char *n) {
if(first==0) {cout<<"无数据!"<<endl;return 0;} student *temp=first; student *p;
if(strcmp(first->outid(),n)==0) { first=first->next;delete temp; cout<<"\n删除成功\n";return 0;} else while(temp->next!=NULL)
{if(strcmp(temp->next->outid(),n)==0)
{p=temp->next;temp->next=temp->next->next;delete p; cout<<"\n删除成功\n";return 0;} else temp=temp->next;}
cout<<"\n查无此人,删除失败\n"; return 0; }
void list::think() {
if(first==0) {cout<<"无数据!"<<endl;return;} int i=0;
student *p=first; while (p!=NULL) {
p=p->next; i++; }
totoal=i;
cout<<"人数:"<<i<<endl; cout<<"数学\n";
cout<<"最高分:"<<hi(0)<<" "<<"最低分:"<<lo(0)<<" "<<"平均分:"; av(0); ev(0);
cout<<"英语\n";
cout<<"最高分:"<<hi(1)<<" "<<"最低分:"<<lo(1)<<" "<<"平均分:"; av(1);