Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <string>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main()
- {
- freopen ("input.txt", "r", stdin);
- freopen ("output.txt", "w", stdout);
- system("color 0B");
- int n;
- cin >> n;
- vector <string> v;
- for (int i = 0; i < n; i++)
- {
- v.push_back(v[i]);
- }
- sort(v.begin(), v.end());
- int j = 0;
- while(next_permutation(v.begin(), v.end()))
- {
- //перебор всех вариантов
- j++;
- }
- cout << j + 1 << endl;
- sort(v.begin(), v.end());
- for (int i = 0; i < v.size(); i++)
- cout << v[i] << " ";
- cout << endl;
- while(next_permutation(v.begin(), v.end()))
- {
- //перебор всех вариантов
- for (int i = 0; i < v.size(); i++)
- cout << v[i] << " ";
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement