cout<<"没有找到要删除的记录!"<<endl;
else
p2->next=p1->next;
}
ofstream fout("e:\\比赛项目.dat",ios::out);
p1=head1;
while(p1!=NULL)
{
fout.write((char*)p1,sizeof(Match));
p1=p1->next;
}
fout.close();
return 0;
}
void print1()
{
creat();
Match *p1=head1;
cout<<"请分别输出比赛项目编号、名称、比赛时间、比赛地点."<<endl;
while(p1!=NULL)
{ cout<<p1->number<<'\t'<<p1->call<<'\t'<<p1->time<<'\t'<<p1->place<<endl;
p1=p1->next;
}
}
void find1()
{ creat();
Match *p1;
p1=head1;
int sign=0;//设置的标记变量
cout<<"请选择要查询比赛项目的哪些信息"<<endl;
cout<<"------按比赛项目的编号查询----1"<<endl;
cout<<"------按比赛项目的名称查询----2"<<endl;
cout<<"------按比赛时间查询----3"<<endl;
cout<<"------按比赛地点查询----4"<<endl;
cout<<"请输入对应信息的编号"<<endl;
int a;
int nu; //查询整形数据条件
char info[20]; //查询字符型数据条件
cin>>a;
switch(a)
{
case 1:cout<<"请输入要查询的比赛编号:"<<endl;
cin>>nu;
while(p1!=NULL)
{ if(p1->number==nu) {sign=1;break;}
p1= p1->next;
}
if (sign==0)
cout<<"没有找到要查询的记录!"<<endl;
else
cout<<p1->number<<'\t'<<p1->call<<'\t'<<p1->time<<'\t'<<p1->place<<endl;
break;
case 2:cout<<"请输入要查询的比赛项目名称:"<<endl;
cin>>info;
while(p1!=NULL)
{ if(p1->call==info) {sign=1;break;}
p1= p1->next;
}
if (sign==0)
cout<<"没有找到要查询的记录!"<<endl;
else
cout<<p1->number<<'\t'<<p1->call<<'\t'<<p1->time<<'\t'<<p1->place<<endl; break;
case 3:cout<<"请输入要查询的比赛时间:"<<endl;
cin>>info;
while(p1!=NULL)
{ if(!strcmp(p1->time,info)) {sign=1;break;}
p1= p1->next;
}
if (sign==0)