大奖赛现场统分。已知某大奖赛有n个选手参赛,m(m>2)个评委为参赛选手评分(最高10分,最低0分)。统分规则为:在每个选手的m个得分中,去掉一个最高分和一个最低平 每日一题--2020049--

大奖赛现场统分。已知某大奖赛有n个选手参赛,m(m>2)个评委为参赛选手评分(最高10分,最低0分)。统分规则为:在每个选手的m个得分中,去掉一个最高分和一个最低分后,取平均分作为该选手的最后得分。要求编程实现:(1)根据n个选手的最后得分,从高到低输出选手的得分名次表,以确定获奖名单;(2)根据各选手的最后得分与各评委给该选手所评分数的差距,对每个评委评分的准确性和评分水准给出一个定量...
摘要由CSDN通过智能技术生成

大奖赛现场统分。已知某大奖赛有n个选手参赛,m(m>2)个评委为参赛选手评分(最高10分,最低0分)。统分规则为:在每个选手的m个得分中,去掉一个最高分和一个最低分后,取平均分作为该选手的最后得分。要求编程实现:
(1)根据n个选手的最后得分,从高到低输出选手的得分名次表,以确定获奖名单;
(2)根据各选手的最后得分与各评委给该选手所评分数的差距,对每个评委评分的准确性和评分水准给出一个定量的评价,每位评委的评分方法:(10 -(评委对选手x的评分 - x的得分)^2 的累加和),从高到低输出各评委得分的名次表。

程序运行示例如下:
How many Athletes?5
How many judges?5
Scores of Athletes:
Athlete 1 is playing.
Please enter his number code:11
Judge 1 gives score:9.5
Judge 2 gives score:9.6
Judge 3 gives score:9.7
Judge 4 gives score:9.4
Judge 5 gives score:9.0
Delete a maximum score:9.7
Delete a minimum score:9.0
The final score of Athlete 11 is 9.500

Athlete 2 is playing.
Please enter his number code:12
Judge 1 gives score:9.0
Judge 2 gives score:9.2
Judge 3 gives score:9.1
Judge 4 gives score:9.3
Judge 5 gives score:8.9
Delete a maximum score:9.3
Delete a minimum score:8.9
The final score of Athlete 12 is 9.100

Athlete 3 is playing.
Please enter his number code:13
Judge 1 gives score:9.6
Judge 2 gives score:9.7
Judge 3 gives score:9.5
Judge 4 gives score:9.8
Judge 5 gives score:9.4
Delete a maximum score:9.8
Delete a minimum score:9.4
The final score of Athlete 13 is 9.600

Athlete 4 is playing.
Please enter his number code:14
Judge 1 gives score:8.9
Judge 2 gives score:8.8
Judge 3 gives score:8.7
Judge 4 gives score:9.0
Judge 5 gives score:8.6
Delete a maximum score:9.0
Delete a minimum score:8.6
The final score of Athlete 14 is 8.800

Athlete 5 is playing.
Please enter his number code:15
Judge 1 gives score:9.0
Judge 2 gives score:9.1
Judge 3 gives score:8.8
Judge 4 gives score:8.9
Judge 5 gives score:9.2
Delete a maximum score:9.2
Delete a minimum score:8.8
The final score of Athlete 15 is 9.000
Order of Athletes:
order final score number code
1 9.600 13
2 9.500 11
3 9.100 12
4 9.000 15
5 8.800 14
Order of judges:
order final score number code
1 9.980 1
2 9.960 2
3 9.900 3
4 9.860 4
5 9.590 5
Over!Thank you!

— 这么长的题目!!—


代码在此:每一步都要知道自己干什么,不要因为题目长就慌了神


#include  <stdio.h>
#include  <math.h>
#define ATHLETE	40           					/* 选手人数最高限 */
#define JUDGE 	     20           					/* 评委人数最高限 */
void  CountAthleteScore(int sh[], float sf[], int n, float f[], int m);
void  Sort(int h[], float f[], int n);
void  Print(int h[], float f[], int n);
void  CountJudgeScore(int ph[], float pf[], int m, float sf[], float f[],
                      int n);
int main(
  • 17
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
三 11. 对参赛结果数进行处理:参赛选手n人(n>1),评委m人(m>2),评委给每一选手一个数score(数score为小于等于10一个正实数)。选手的最后得分lastScore计算方法为 (1)m<9时,去掉一个最高分一个最低后另m-2个得分均值。 (2)m≥9时,去掉两个最高分和两个最低后另m-4个得分均值。 假设事先已经建立了text型的数据文件f1.txt,其依次记录着n个选手的编号(一个正整数)、姓名(一个字符串)以及m个评委给出的得分。 请编制程序,依次从数据文件f1.txt读入n个选手的有关信息,而后按上述规定方法计算出每一个选手的最后得分,而且往屏幕上以及另一个text型文件f2.txt同时输出如下形式的结果信息。 假设参赛选手人数n=5,评委人数m=7,磁盘文件f1.txt的初始数据为: 1 zhangjin 8.8 9.3 7.9 8.7 8.9 9.7 9.2 2 lintao 8.9 8.2 8.6 8.8 8.5 9.1 9.3 3 guojian 8.9 8.4 8.7 8.6 8.6 8.4 8.6 4 maling 7.9 8.3 8.5 8.6 8.5 8.9 8.3 5 liuyifan 9.5 9.1 9.8 9.2 9.0 9.5 8.9 那么,程序执行后,屏幕显示结果以及磁盘文件f2.txt的结果均应该为: ---------------------------------------------------------- 参赛号 姓 名 最高分 最低 累积 最后得分 ---------------------------------------------------------- 1 zhangjin 9.7 7.9 44.9 8.98 2 lintao 9.3 8.2 43.9 8.78 3 guojian 8.9 8.4 42.9 8.58 4 maling 8.9 7.9 42.2 8.44 5 liuyifan 9.8 8.9 46.3 9.26 ---------------------------------------------------------- 思考:可进一步考虑找出比赛的第1至第k名,也在屏幕以及f2.txt同时输出相关的结果信息(k小于等于n,并规定若多个选手最后得分相同时,则有效(即已删除原来的最高分后)最高分高者名次优先)。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值