Computer Scientists are Pretty Pessimistic

Tuesday, 1 March 2016

Use of next_permutaion in C++

#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
    string s = "imtiyaz";

    while(next_permutation(s.begin(),s.end()))
        cout<<s<<endl;

    return 0;
}

1 comment:

  1. It'd be more helpful if you show how will be the output :)

    ReplyDelete