You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.3 KiB
107 lines
2.3 KiB
int info_show() //打印所有信息
|
|
{ int i;
|
|
for(i=0;i<snum;i++)
|
|
{
|
|
printf("\n---------------------------------------------------------------------------------------------\n");
|
|
printf("| 编号:%04d | 姓名:%s | 平均分%.2f |\n",st[i].id,st[i].name,st[i].sum);
|
|
int j;
|
|
printf("|十位评委成绩:");
|
|
for(j=0;j<10;j++)
|
|
{
|
|
printf("[%d]%4.2f ",j+1,st[i].score[j]);
|
|
}
|
|
printf("\n---------------------------------------------------------------------------------------------\n");
|
|
}
|
|
getchar();
|
|
getchar();
|
|
return 0;
|
|
}
|
|
int info_find() //检索信息
|
|
{
|
|
int i;
|
|
printf("请输入参赛编号\n");
|
|
int k;
|
|
scanf("%d",&k);
|
|
for(i=0;i<snum;i++)//遍历结构体数组course[]查找对应的 课程id
|
|
{
|
|
if(st[i].id==k)//找到后输出
|
|
{
|
|
printf(" 编号:%04d 姓名:%s :平均分%.2f \n",st[i].id,st[i].name,st[i].sum);
|
|
int j;
|
|
printf("十个评委成绩:\n");
|
|
for(j=0;j<10;j++)
|
|
{
|
|
printf("[%d]%.2f ",j+1,st[i].score[j]);
|
|
}
|
|
printf("\n");
|
|
break;
|
|
}
|
|
}
|
|
getchar();getchar();
|
|
return 0;
|
|
}
|
|
int grade_modify()
|
|
{
|
|
int id,i;
|
|
printf("请输入参赛编号:");
|
|
|
|
scanf("%d",&id);
|
|
for(i=0;i<snum;i++)//遍历结构体数组course[]查找对应的 课程id
|
|
{
|
|
if(st[i].id==id)//找到后输出
|
|
{
|
|
printf(" 编号:%04d 姓名:%s :平均分%.2f \n",st[i].id,st[i].name,st[i].sum);
|
|
int j;
|
|
printf("十个评委成绩:\n");
|
|
for(j=0;j<10;j++)
|
|
{
|
|
printf("[%d]%.2f ",j+1,st[i].score[j]);
|
|
}
|
|
printf("\n");
|
|
|
|
while(1)
|
|
{
|
|
int k;
|
|
printf("\n\t\t请输入要修改第几位评委的评分:") ;
|
|
scanf("%d",&k);
|
|
printf("\t\t请输入要新成绩:");
|
|
scanf("%lf",&st[i].score[k-1]);
|
|
printf("\t\t十个评委成绩:\n");
|
|
for(j=0;j<10;j++)
|
|
{
|
|
printf("[%d]%.2f ",j+1,st[i].score[j]);
|
|
}
|
|
printf("\n");
|
|
printf("\t\t修改成功!\n");
|
|
printf("\t\t是否继续修改此人成绩 (y/n) : ");
|
|
int flag;
|
|
scanf("%d",&flag);
|
|
if(flag==0)
|
|
break;
|
|
//printf("gg");
|
|
}
|
|
// printf("kk");
|
|
double mi=0xffffff,ma=0;
|
|
for( j=0;j<10;j++)
|
|
{
|
|
|
|
if(mi>st[snum].score[j])
|
|
{
|
|
mi=st[snum].score[j];
|
|
}
|
|
if(ma<st[snum].score[j])
|
|
{
|
|
ma=st[snum].score[j];
|
|
}
|
|
st[snum].sum+=st[snum].score[j];
|
|
}
|
|
st[snum].sum=st[snum].sum-mi-ma;
|
|
st[snum].sum/=8;
|
|
break;
|
|
}
|
|
}
|
|
|
|
save();
|
|
return 0;
|
|
}
|