Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <cstdlib>
- #include <string>
- using namespace std;
- int main()
- {
- int i;
- std::string masinde[3] = {" \t FAMILY", " \t FRIENDS", " \t OTHERS"};
- std::sort(masinde, &masinde[3]);
- int p = 1;
- do
- {
- std::cout<<"Mzunguko wa:"<<p<<" ";
- for(i = 0; i < 3; i++)
- {
- std::cout <<masinde[i];
- if(i < 3 - 1) std::cout << " ";
- }
- p++;
- std::cout << std::endl;
- } while(std::next_permutation(masinde, &masinde[3]));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement