{
  "question_id": 7447975,
  "question_title": "体操打分求最高，最低，平均，中位",
  "question_content": "<p>体操比赛中&#xff0c;10名评委为5名选手打分&#xff0c;其分数已经存放在一个二维数组中&#xff0c;列出每个选手的&#xff1a;最高分&#xff0c;最低分&#xff0c;平均分&#xff0c;中位分。<br />\n平均分算法&#xff1a;除去最高分和最低分后&#xff0c;剩下8位评委的分数平均值。<br />\n中位分&#xff1a;10个评分从高到低排列&#xff0c;第5位和第6位的平均分为中位分。</p>",
  "difficulty": "简单",
  "answer_id": 53427952,
  "answer_content": "<pre>\n<code class=\"language-cpp\">#include &lt;stdio.h&gt;\n  \nint main()\n{\n    float a[1][10],max,min,sum;\n    int i,aver;\n    max&#61;0;\n    min&#61;100;\n    sum&#61;0;\n    for(i&#61;0;i&lt;10;i&#43;&#43;)\n    {\n        scanf(&#34;%f&#34;,&amp;a[0][i]);\n        if(a[0][i]&gt;max) \n            max&#61;a[0][i];\n        if(a[0][i]&lt;min)\n            min&#61;a[0][i];  \n        sum&#43;&#61;a[0][i];\n    }\n    aver &#61; (sum-max-min)/8 ;\n    printf(&#34;aver:%d\\n&#34;,aver);\n    return 0;\n}</code></pre>\n\n<p> </p>\n",
  "tag_name": "c++",
  "cpp": "#include <stdio.h>\nint main()\n{\n\tfloat a[1][10],max,min,sum;\n\tint i,aver;\n\tmax=0;\n\tmin=100;\n\tsum=0;\n\tfor(i=0;i<10;i++)\n\t{\n\t\tscanf(\"%f\",&a[0][i]);\n\t\tif(a[0][i]>max) \n\t\t\tmax=a[0][i];\n\t\tif(a[0][i]<min)\n\t\t\tmin=a[0][i];  \n\t\tsum+=a[0][i];\n\t}\n\taver = (sum-max-min)/8 ;\n\tprintf(\"aver:%d\\n\",aver);\n\treturn 0;\n}",
  "topic_link": "https://bbs.csdn.net/topics/600470269",
  "status": 0,
  "keywords": "算法初阶,基础知识,算法基础,设计算法,分析分治算法",
  "license": "csdn.net",
  "notebook": {
    "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/88.ipynb?type=file"
  },
  "notebook_enable": 1,
  "author": "lovely0909"
}