我是sb

1、枚举全排列

盯着代码看了10min

// 不能用while,否则会先执行一次,这样就忽略了数组初始的一种排列
do
{
    do sth
}while (next_permutation(a+1,a+n+1));