全排列

· · 个人记录

do{
    for(int i=1;i<=n;i++)
        printf("%d ",a[i]);
    cout<<endl;
}while(next_permutation(a+1,a+n+1));