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;
}
}
#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;
}
}
相关文章推荐
- poj 题目1883 排列(STL----next_permutation)
- POJ1256 Anagram STL中的next_permutation()
- STL(next_permutation)poj 1833:排列
- poj-1833-排列 stl next_permutation(a,a+n)
- STL的next_permutation与prev_permutation解析
- 【转】【STL】next_permutation的原理和使用
- STL中的next_permutation
- 浅谈STL之(一) 排序函数——next_permutation(a,a+n)
- STL算法之 next_permutation、prev_permutation 的原理和实现
- STL之next_permutation() 全排列函数
- POJ 题目1256 Anagram(next_permutation)
- poj3785----全排序(STL---next_permutation())(a一送 五)
- POJ 1833:排列 [#使用STL的next_permutation函数生成全排列#]
- STL 中 next_permutation 的全排列思路
- 蓝桥杯 - 算法提高 排列数 【STL-next_permutation求全排列】
- HDU 1716 排列2 (stl,next_permutation)
- C++STL的next_permutation
- hdu Ignatius and the Princess II_STL next_permutation的用法
- STL_算法_排列(prev_permutation、next_permutation)
- 百练1833:排列(stl:next_permutation)