solution.json 1.3 KB
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "e87e276f38b048e8889e2fe7fe79b084",
  "keywords": "算法高阶,数论算法,算法问题选编,整数的因子分解",
  "title": "输出整数的全排列",
  "desc": [
    {
      "content": "\n输入整数n(3<=n<=7),编写程序输出1,2,....,n整数的全排列,按字典序输出。\n输入样例:\n输入:3\n输出:123 132 213 231 312 321",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "python"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ]
  ],
  "template": {
    "content": "import random\nn = int(input())\nt = list()\nt1 = set()\nfor i in range(1,n+1):\n\tt.append(str(i))\nwhile True:\n\tsum = 1\n\tfor i in range(1, n + 1):\n\t\tsum *= i\n\tif len(t1) >= sum:\n\t\tbreak\n\trandom.shuffle(t)\n\tt1.add(\"\".join(t))\ns = sorted(t1)\nfor i in s:\n\tprint(i,end=\" \")",
    "language": "python"
  },
  "node_id": "dailycode-2bef970158ef4ce2bc686d63ee943610",
  "license": "csdn.net",
  "created_at": 1637894161,
  "topic_link": "https://bbs.csdn.net/topics/600470295"
}