{
"question_id": 7447975, "question_title": "体操打分求最高,最低,平均,中位", "question_content": "<p>体操比赛中,10名评委为5名选手打分,其分数已经存放在一个二维数组中,列出每个选手的:最高分,最低分,平均分,中位分。<br />\n平均分算法:除去最高分和最低分后,剩下8位评委的分数平均值。<br />\n中位分:10个评分从高到低排列,第5位和第6位的平均分为中位分。</p>", "difficulty": "简单", "answer_id": 53427952, "answer_content": "<pre>\n<code class=\"language-cpp\">#include <stdio.h>\n \nint main()\n{\n float a[1][10],max,min,sum;\n int i,aver;\n max=0;\n min=100;\n sum=0;\n for(i=0;i<10;i++)\n {\n scanf("%f",&a[0][i]);\n if(a[0][i]>max) \n max=a[0][i];\n if(a[0][i]<min)\n min=a[0][i]; \n sum+=a[0][i];\n }\n aver = (sum-max-min)/8 ;\n printf("aver:%d\\n",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"
}