Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- vector<int> v;
- const int n = 4;
- for (int i = 0; i < n; i++) v.push_back(i + 1);
- do {
- for (int e: v) cout << e << ' '; cout << endl;
- } while (next_permutation(v.begin(), v.end()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement