全排列 问题描述 对于给定的正整数n(n>=1),求1~n的所有全排列 输入示例 3 输出示例 123 132 312 213 231 321 基本思路: 就很简单……查数字是否之前被用过,然后回溯…… 代码实现: #include <iostream> using namespace std; int n;//输入表示n位数 int solution;//解的个数 int set[10000];//记录某一位置的数字 int mark[10000];//标记该数字 void dfs(int k