next_permutation 是一个定义在 <algorithm> 中的一个全排列函数, 用于按顺序生成一个数列的全排列
基本用法 :
int a[] = {1, 2, 3}; do{ cout << a[0] << a[1] << a[2] << endl; }while(next_permutation(a, a+3));