C语言青年歌手大奖赛评委会打分
时间: 2023-12-05 07:41:21 浏览: 119
C语言程序课程设计—歌手比赛系统
4星 · 用户满意度95%
以下是C语言实现青年歌手大奖赛评委会打分的代码示例:
```c
#include <stdio.h>
#define MAX_JUDGE_NUM 100
int main()
{
int judge_num, i, max_score = -1, min_score = 101;
float total_score = 0, score;
printf("请输入评委人数:");
scanf("%d", &judge_num);
for (i = 0; i < judge_num; i++)
{
printf("请输入第%d位评委的分数:", i + 1);
scanf("%f", &score);
if (score > max_score)
{
max_score = score;
}
if (score < min_score)
{
min_score = score;
}
total_score += score;
}
total_score = (total_score - max_score - min_score) / (judge_num - 2);
printf("该选手的得分为:%.2f\n", total_score);
return 0;
}
```
阅读全文