Cod sursa(job #2561587)
Utilizator | Data | 28 februarie 2020 22:45:36 | |
---|---|---|---|
Problema | Generare de permutari | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.2 kb |
#import<bits/stdc++.h>
main(){int n,v[]={1,2,3,4,5,6,7,8};std::ifstream("permutari.in")>>n;std::ofstream g("permutari.out");do for(int i=0;i<n;)g<<v[i++]<<' ';while(g<<'\n',std::next_permutation(v,v+n));}