?
AC代码:
?
#include#include #include #include using namespace std; char str[55]; int main() { while(scanf("%s", str), str[0] != '#') { int len = strlen(str); if(next_permutation(str, str + len)) printf("%s\n", str); else printf("No Successor\n"); } return 0; }
?
?
?
?
?
?