全排列特定模板

    xiaoxiao2021-03-25  7

    很好用的全排列模板

    #include<algorithm> #include<cstdio> using namespace std; int ss[11] = {1,2,3,4,5,6,7,8,9,10}; int main() { int n; scanf("%d",&n); do{ for(int i=0;i<n;i++) printf("%d",ss[i]); printf("\n"); } while(next_permutation(ss,ss+n))///字典序排列; }
    转载请注明原文地址: https://ju.6miu.com/read-200195.html

    最新回复(0)