{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "eb2de64e11fb45be92fbe9382ff09710",
  "keywords": "算法初阶,排序和顺序统计量,中位数和顺序统计量",
  "title": "编程通过键盘输入每一位运动员",
  "desc": [
    {
      "content": "\n<p>体操比赛成绩统计。多名运动员&#xff0c;多个评委打分&#xff0c;去掉一个最高分和去掉一个最低分&#xff0c;对其余分数求平均分作为一个运动员成绩。\n编程通过键盘输入每位运动员编号和每个评委的成绩&#xff0c;求出运动员的最终成绩&#xff0c;并将运动员编号和最终成绩保存在一个字典中&#xff0c;形如{编号1:最终成绩1,学号2:最终成绩2.....&#xff0c;并将结果输出。</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "python"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ]
  ],
  "template": {
    "content": "t = int(input('请输入评委人数（不得少于3人）：'))\ns = int(input('请输入学生人数（不得少于1人）：'))\nstus = []\nfor i in range(s):\n\tstu = {'score':[]}\n\tstu.update({'sn':str(input('----\\n请输入学生学号：'))})\n\tfor j in range(t):\n\t\tstu['score'].append(input('请输入评委'+str(j+1)+'的评分：'))\n\tstu['score'].sort()\n\tstu.update({'min':stu['score'].pop(0)})\n\tstu.update({'max':stu['score'].pop()})\n\tstu.update({'avg':eval('+'.join(stu['score']))/len(stu['score'])})\n\tstus.append(stu)\nr = {n['sn']:n['avg'] for n in stus}\nprint(r)",
    "language": "python"
  },
  "node_id": "dailycode-37725ca16b9f48d7a618ebe5d654955d",
  "license": "csdn.net",
  "created_at": 1637894161,
  "topic_link": "https://bbs.csdn.net/topics/600469993"
}