poj 1146 ID Codes

#include<iostream>
#include
<algorithm>
#include
<string>
using namespace std;
int main()
{
string line;
while(cin>>line&&line!="#")
{
if(next_permutation(line.begin(),line.end()))
cout
<<line<<endl;
else
cout
<<"No Successor\n";
}
return 0;
}

  

posted on 2011-07-17 23:51  sysu_mjc  阅读(100)  评论(0编辑  收藏  举报

导航