{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "f29824db6c66441296e9fa9229ae8e23",
  "keywords": "桶排序,算法初阶,线性时间排序,排序和顺序统计量",
  "title": "选择排序法",
  "desc": [
    {
      "content": "\n<p>使用选择排序法对10个整数进行由大到小排序。</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 a[10];\n\tint i,j,temp=0;\n\tint k,x=0;\n\tprintf(\"输入10个数：\\n\");\n\tfor(i=0; i<10; i++)\n\t\tscanf(\"%d\",&a[i]);\n\tfor(i=0; i<9; i++) {\n\t\tk = i;\n\t\tfor(j=i+1; j<10; j++)\n\t\t\tif(a[j]<a[i])\n\t\t\t\tk = j;\n\t\ttemp=a[i];\n\t\ta[i]=a[k];\n\t\ta[k]=temp;\n\t}\n\tprintf(\"排序后：\\n\");\n\tfor(i=0; i<10; i++)\n\t\tprintf(\"%d \",a[i]);\n\tgetchar();\n\tgetchar();\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-3ca87741ab2a4756b5cfc06351fe7944",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470158"
}