{ "type": "code_options", "author": "csdn.net", "source": "solution.md", "exercise_id": "f29824db6c66441296e9fa9229ae8e23", "keywords": "桶排序,算法初阶,线性时间排序,排序和顺序统计量", "title": "选择排序法", "desc": [ { "content": "\n

使用选择排序法对10个整数进行由大到小排序。

", "language": "markdown" } ], "answer": [ { "content": "", "language": "cpp" } ], "prepared": [ [ { "content": "", "language": "cpp" } ], [ { "content": "", "language": "cpp" } ], [ { "content": "", "language": "cpp" } ] ], "template": { "content": "#include \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]