{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "337b3f0460f140e0a2e1984f78f1cbb2",
  "keywords": "算法初阶,基础知识,算法基础,设计算法,分析分治算法",
  "title": "一个班有10个同学，通过键盘输入成绩，并打印输出，每行输出5个同学的成绩。并求出平均成绩，最高分、最低分并输出。",
  "desc": [
    {
      "content": "\n<p>一个班有10个同学&#xff0c;通过键盘输入成绩&#xff0c;\n并打印输出&#xff0c;每行输出5个同学的成绩。并求出平均成绩&#xff0c;最高分、最低分并输出。算法分析&#xff1a;\n(1)定义一个数组用来存放10个成绩数据。\n(2)用循环结构实现成绩输入&#xff1b;\n(3)用循环结构实现成绩输出,并控制换行&#xff1b;\n(4)使用循环结构求平均成绩、最高分、最低分并输出。</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <stdio.h>\nint main(){\n\tint x,i,max=0,min=0;\n\tdouble sum=0,ave=0;\n\tint a[10];\n\tfor(i=0;i<10;i++){\n\t\tscanf(\"%d\",&a[i]);\n\t\tif(i==0)\n\t\t\tmin = a[i];\n\t\tsum+=a[i];\n\t\tif(max<a[i])\n\t\t\tmax=a[i];\n\t\tif(min>a[i])\n\t\t\tmin=a[i];\n\t}\n\tave=sum/10;\n\tfor(i=0;i<5;i++)\n\t\tprintf(\"%d \",a[i]);\n\t printf(\"\\n\");\n\tfor(i=5;i<10;i++)\n\t\tprintf(\"%d \",a[i]);\n\tprintf(\"平均成绩%f,最高分%d,最低分%d \",ave,max,min);\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-b5d53da6929b4a0abe12a37e1d7cc77d",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470145"
}