View difference between Paste ID: eKDezcf6 and H809XjJE
SHOW: | | - or go back to the newest paste.
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)
8
{
9
    for (int i = 0; i < x.size() - 1; i++)
10
    {
11
        swap(x.at(i), x.at(i + 1));
12
        a.insert(x);
13
        swap(x.at(i), x.at(i + 1));
14
    }
15
}
16
17
int main()
18
{
19
    string x;
20
    cin >> x;
21
    set<string> a;
22
    fnc(x, a);
23
    return 0;
24
}