|
|
|
@ -213,84 +213,6 @@ puts("
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************查 找 函 数***************/
|
|
|
|
|
void find(scl *head)
|
|
|
|
|
{
|
|
|
|
|
scl *q=head;
|
|
|
|
|
int num,x,i,cha,xiang,flag=0;
|
|
|
|
|
printf("按学校查找请输入1,按项目查找请输入2\n");
|
|
|
|
|
scanf("%d",&cha);
|
|
|
|
|
if(cha==1)
|
|
|
|
|
{
|
|
|
|
|
printf("请输入你要查询的学校编号:");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
while(q!=NULL)
|
|
|
|
|
{
|
|
|
|
|
if(num==q->sclnum)
|
|
|
|
|
{
|
|
|
|
|
printf("===================================\n");
|
|
|
|
|
printf("学校编号\n");
|
|
|
|
|
printf("%d\n",q->sclnum);
|
|
|
|
|
for(x=0;x<M+W;x++)
|
|
|
|
|
{
|
|
|
|
|
printf("项目编号\n");
|
|
|
|
|
printf("%d\t\n",q->a[x].itmnum);
|
|
|
|
|
printf("项目类型\n");
|
|
|
|
|
printf("%d\t\n",q->a[x].itmkind);
|
|
|
|
|
printf("有%d个获奖名次:\t",q->a[x].level);
|
|
|
|
|
for(i=0;i<q->a[x].level;i++)
|
|
|
|
|
{
|
|
|
|
|
printf("第%d名\t",q->a[x].range[i]);
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
}
|
|
|
|
|
printf("男子团体项目总分:%d\n",q->mscore);
|
|
|
|
|
printf("女子团体项目总分:%d\n",q->wscore);
|
|
|
|
|
printf(" 学校项目总得分:%d\n\n",q->sum);
|
|
|
|
|
printf("\n");
|
|
|
|
|
flag=1;
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
q=q->next;
|
|
|
|
|
}
|
|
|
|
|
if(flag==0)
|
|
|
|
|
puts("对不起!没有您要查询的对象");
|
|
|
|
|
}
|
|
|
|
|
else if(cha==2)
|
|
|
|
|
{
|
|
|
|
|
printf("请输入你要查询的项目编号:");
|
|
|
|
|
scanf("%d",&xiang);
|
|
|
|
|
while(q!=NULL)
|
|
|
|
|
{
|
|
|
|
|
for(x=0;x<W+M;x++)
|
|
|
|
|
{
|
|
|
|
|
if(xiang==q->a[x].itmnum&&q->a[x].itmkind==111)
|
|
|
|
|
{
|
|
|
|
|
printf("获得前5名的学校为:\n");
|
|
|
|
|
for(i=0;i<1;i++)
|
|
|
|
|
printf("学校编号和名称分别为:%d,%s\n",q->sclnum,q->sclname);
|
|
|
|
|
flag=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if(xiang==q->a[x].itmnum&&q->a[x].itmkind==222)
|
|
|
|
|
{
|
|
|
|
|
printf("获得前3名的学校为:\n");
|
|
|
|
|
for(i=0;i<3;i++)
|
|
|
|
|
printf("学校编号和名称分别为:%d,%s\n",q->sclnum,q->sclname);
|
|
|
|
|
flag=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
q=q->next;
|
|
|
|
|
}
|
|
|
|
|
if(flag==0)
|
|
|
|
|
puts("对不起!没有您要查询的对象");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**********************主 函 数*************************/
|
|
|
|
|
int main() //主函数1
|
|
|
|
|
{
|
|
|
|
|
int ch;
|
|
|
|
@ -303,7 +225,7 @@ switch(ch)
|
|
|
|
|
{
|
|
|
|
|
case 1: menu();g=input(); break;
|
|
|
|
|
case 2: menu();output(g); break;
|
|
|
|
|
case 3: menu();find(g); break;
|
|
|
|
|
//case 3: menu();find(g); break;
|
|
|
|
|
case 4: menu();printf("******************************谢谢您的使用!******************************\n");
|
|
|
|
|
printf("******************************生命在于运动!******************************\n");exit(0);
|
|
|
|
|
default: menu();printf("对不起!输入有误!\n");exit(0);
|