您的位置:首页 > 其它

POJ1061(STL next_permutation)

2008-09-10 13:32 239 查看
不好好看书的下场。想了N久,其实用STL next_permutation真的是非常简单。#include<iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string input;
while(cin>>input && input != "#")
{
if(next_permutation(input.begin(),input.end()))
cout<<input<<endl;
else
cout<<"No Successor"<<endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: