fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s="jahid";
  7. do{
  8. cout<<s<<endl;
  9. }while(next_permutation(s.begin(),s.end()));
  10.  
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
jahid
jaidh
jaihd
jdahi
jdaih
jdhai
jdhia
jdiah
jdiha
jhadi
jhaid
jhdai
jhdia
jhiad
jhida
jiadh
jiahd
jidah
jidha
jihad
jihda