ACM PKU 1731 Orders STL最基本应用

#include <iostream>
#include 
<string>
#include 
<algorithm>
 
using namespace std;

int main()
{
    
string str;
    
while(cin>>str)
    
{
        sort(
&str[0],&str[0]+str.length());//先排序
        cout<<str<<endl;//输出排序后的
        while(next_permutation(&str[0],&str[0]+str.length()))
        
{
            cout
<<str<<endl;
        }

    }

    
return 0;
}

posted on 2007-09-20 21:58 流牛ζ木马 阅读(824) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

公告

MY Email/MSN :mars1021@163.com QQ : 27402040 流牛ζ木马

常用链接

留言簿(6)

随笔档案

相册

搜索

最新随笔

最新评论

阅读排行榜

评论排行榜