#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string GG = "Thats.GG"; while(next_permutation(GG.begin(), GG.end())) { cout << GG << endl; } return 0; }
For when you need every possible combination.