Monday, August 1, 2016

UVA 146 - ID Codes Solution

Unknown
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

int main()
{
    while(1)
    {
        char s[55];
        gets(s);
        if(s[0] == '#')
            break;
        if (!next_permutation(s,s+strlen(s)))
        {
            puts("No Successor");
            continue;
        }
        puts(s);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,