Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
#include <stdio.h>
#include <algorithm>

using namespace std;

int main ()
{
    char A [100], Len;

    while (scanf ("%s", A )) {

        if ( A [0] == '#' )
            break;

        Len = strlen (A);

        if (next_permutation (A, A + Len) )
            printf("%s\n", A);
        else
            printf("No Successor\n");
    }

    return 0;
}
Posted
Comments
Richard MacCutchan 27-Jan-15 6:35am    
Why do you want it converted?
KarstenK 29-Jan-15 12:34pm    
My tip is: Homework :-O

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900