uva 146 ID Codes(下一个排列,水了一大笔呀)

还能怎么说还能怎么说……上代码吧直接。。

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;

int main()
{
    char s[60];
    while(scanf("%s",s)!=EOF)
    {
        if(s[0]=='#')
            break;
        if(next_permutation(s,s+strlen(s))!=NULL)
        {
            printf("%s\n",s);
        }
        else
            printf("No Successor\n");
    }
    return 0;
}

好吧,就是这个样子了。。

你可能感兴趣的:(Algorithm,uva)