{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "95b95d395fef41e390d3b512a7c62705",
  "keywords": "算法初阶,快速排序,快速排序的描述,排序和顺序统计量",
  "title": "排序",
  "desc": [
    {
      "content": "\n试题描述\n由键盘上输入n个整数，请将这些数从大到小排序，然后输出排序后的数列。\n输入\n输入包含两行：\n第一行是n（1 <= n <= 1000）。\n第二行是n个整数，邻近两数之间用一个空格隔开。\n输出\n输出排序后的n个整数，邻近两数之间用一个空格隔开。\n输入示例\n5\n8 2 5 1 2\n输出示例\n8 5 2 2 1\n数据范围\n输入和输出均为int范围的整数",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": " #include<iostream>\nusing namespace std;\nint main() {\n\tint n,tmp;\n\tcin >> n;\n\tint *a = new int[n];\n\tfor (int i = 0; i < n; i++)\n\t\tcin >> a[i];\n\tfor (int i = 0; i < n - 1; i++) {\t\t\n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] < a[j]) {\n\t\t\t\ttmp = a[i];\n\t\t\t\ta[i] = a[j];\n\t\t\t\ta[j] = tmp;\n\t\t\t}\n\t\t}\n\t}\n\tfor (int i = 0; i < n; i++) {\n\t\tcout << a[i];\n\t\tif (i != n - 1)\n\t\t\tcout << \" \";\n\t}\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-576049e4d5e9473fb838a71d21ebf8e7",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470259"
}