xT30x

Func3

Oct 10th, 2022
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5. using ld = long double;
  6.  
  7. void fnc(string x, set<string> &a, string alp)
  8. {
  9.     string ax = x;
  10.     for (auto &cl : x)
  11.     {
  12.         for (auto cc : alp)
  13.         {
  14.             cl = cc;
  15.             a.insert(x);
  16.             x = ax;
  17.         }
  18.     }
  19. }
  20.  
  21. int main()
  22. {
  23.     string alp(26, 'a');
  24.     iota(alp.begin(), alp.end(), 97);
  25.     string x;
  26.     cin >> x;
  27.     set<string> a;
  28.     fnc(x, a, alp);
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment