Advertisement
johnsubira

Random strings

Feb 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cstdlib>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int i;
  11.  
  12. std::string masinde[3] = {" \t FAMILY", " \t FRIENDS", " \t OTHERS"};
  13.  
  14. std::sort(masinde, &masinde[3]);
  15.  
  16. int p = 1;
  17. do
  18. {
  19. std::cout<<"Mzunguko wa:"<<p<<" ";
  20. for(i = 0; i < 3; i++)
  21. {
  22. std::cout <<masinde[i];
  23. if(i < 3 - 1) std::cout << " ";
  24. }
  25.  
  26. p++;
  27. std::cout << std::endl;
  28. } while(std::next_permutation(masinde, &masinde[3]));
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement