Advertisement
johnsubira

Hello there

Mar 1st, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a;
  9. int g = 1;
  10. const int x = 3;
  11. std::string name[x] = {"\t FAMILY","\t FRIEND","\t OTHERS"};
  12. std::sort(name,&name[x]);
  13.  
  14. std::cout<<"\n\n\t\t\t GROUP:"<<g<<endl;
  15. int r = 1;
  16. do{
  17. std::cout<<"R:"<<r;
  18. for ( a = 0; a < x; a ++ )
  19. {
  20. std::cout<<name[a];
  21. if ( x > 1) std::cout<<" ";
  22. }
  23. r++;
  24. g++;
  25. std::cout<<std::endl;
  26. }while(next_permutation(name,&name[x]));
  27.  
  28. system("pause");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement