简单题
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include
<
iostream
>
#include < cstdio >
#include < cstdlib >
#include < cstring >
#include < algorithm >
using namespace std;
char st[ 100 ];
int main()
{
// freopen("t.txt", "r", stdin);
while (scanf( " %s " , st))
{
if (strcmp(st, " # " ) == 0 )
break ;
if (next_permutation(st, st + strlen(st)))
printf( " %s\n " , st);
else
printf( " No Successor\n " );
}
return 0 ;
}
#include < cstdio >
#include < cstdlib >
#include < cstring >
#include < algorithm >
using namespace std;
char st[ 100 ];
int main()
{
// freopen("t.txt", "r", stdin);
while (scanf( " %s " , st))
{
if (strcmp(st, " # " ) == 0 )
break ;
if (next_permutation(st, st + strlen(st)))
printf( " %s\n " , st);
else
printf( " No Successor\n " );
}
return 0 ;
}