tuki2501

qbhv.cpp

Nov 7th, 2021
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.   string s;
  6.   cin >> s;
  7.   sort(s.begin(), s.end());
  8.   vector<string> res;
  9.   do {
  10.     res.push_back(s);
  11.   } while (next_permutation(s.begin(), s.end()));
  12.   cout << res.size() << '\n';
  13.   for (auto &i : res) cout << i << '\n';
  14. }
Advertisement
Add Comment
Please, Sign In to add comment