Permutation Id..? C++
<p>I am using permutation to generate a string (using each of its character) into "helloworld!", however it took...176791 to get to "helloworld!" Is there a ways so I can just input: 176791 to quickly permutate to "helloworld!"?</p>

<pre><code>        ...
176790. helloworl!d
176791. helloworld!
</code></pre>

<p>My code:</p>

<pre><code>#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;algorithm&gt;

int main( void )
{
    ::UINT64 Count = 0;
    std::string SomeString = "eohldo!lwrl";
    do
    {
        Count ++;
        std::cout &lt;&lt; Count &lt;&lt; ". " &lt;&lt; SomeString &lt;&lt; std::endl;
        if( SomeString == "helloworld!" )
            break;
    } while( std::next_permutation( SomeString.begin( ), SomeString.end( ) ) );

    ::getchar( );
    return( 0 );
};
</code></pre>
