uva146 ID Codes
全排列的水题。 next_permutation 水过。。。
#include <algorithm>
using namespace std;
#include <stdio.h>
#include <string.h>
char sb[25];
int main()
{
while(gets(sb) != NULL && sb[0] != '#')
{
if(next_permutation(sb, sb + strlen(sb)))
printf("%s\n", sb);
else
printf("No Successor\n");
}
return 0;
}