class Solution {
public:
vector<vector<int>> permutation(vector<int>& nums) {
sort(nums.begin(),nums.end()); //先把输入的数字进行排序
vector<vector<int> > res; //二维vector
do res.push_back(nums); // 将nums中的元素加到res后面
while (next_permutation(nums.begin(),nums.end())); //这个函数走到最大序列后会返回false
return res;
}
};