题意:给定一个串(好好吃的感觉),求按照字典序的它的下一个串
熟悉一下next_permutation ,水题
AC代码
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
string a;
while(cin>>a && a!="#")
{
if(next_permutation(a.begin(),a.end()))
{
cout<<a<<endl;
}
else
cout<<"No Successor\n";
}
return 0;
}