POJ 1731
#include<iostream>
#include<string>
#include<algorithm>
using namespace std; int main()
{
int NUM;
string list;
cin>>list,NUM = list.length(),sort(&list[],&list[]+NUM),cout<<list<<endl;
while(next_permutation(&list[],&list[]+NUM))cout<<list<<endl;
}
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com
POJ 1731的更多相关文章
- POJ 1731 Orders(STL运用)
题目地址:POJ 1731 这题能够直接用STL函数做,非常轻松..next_permutation函数非常给力.. 代码例如以下: #include <algorithm> #inclu ...
- poj 1731 Orders
http://poj.org/problem?id=1731 Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9 ...
- poj 1731 Orders(暴力)
题目链接:http://poj.org/problem?id=1731 思路分析:含有重复元素的全排列问题:元素个数为200个,采用暴力枚举法. 代码如下: #include <iostream ...
- Orders POJ - 1731
The stores manager has sorted all kinds of goods in an alphabetical order of their labels. All the k ...
- POJ 1731:Orders
Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9940 Accepted: 6048 Descriptio ...
- 是时候学一波STL了。。。
都到如今了还不会STL,赶紧学习一下. .. 头文件#include<algorithm> 加上 using namespace std. 求下一个排列的函数:next_permutati ...
- POJ 题目分类(转载)
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965 ...
- (转)POJ题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- poj分类
初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. ( ...
随机推荐
- C++ Bitsets
C++ Bitsets给程序员提供一种位集合的数据结构.Bitsets使用许多二元操作符,比如逻辑和,或等. Constructors 创建新bitsets Operators 比较和赋值bitset ...
- 死亡之ping(Ping of Death)
最简单的基于IP的攻击可能要数著名的死亡之ping,这种攻击主要是由于单个包的长度超过了IP协议规范所规定的包长度.产生这样的包很容易,事实上,许多操作系统都提供了称为ping的网络工具.在为Wind ...
- Cadence OrCad Allegro SPB 16.6 下载及安装破解指南
Cadence公司的电子设计自动化产品涵盖了电子设计的整个流程,包括系统级设计,功能验证,IC综合及布局布线,模拟.混合信号及射频IC设计,全定制集成电路设计,IC物理验证,PCB设计和硬件仿真建模等 ...
- c++11: less的用法
less主要是重载了operator()方法,用来比较lhs 和 rhs std::less::operator() bool operator()(const T &lhs, const T ...
- WP开发笔记——程序的退出方法
Windows Phone程序中,并没有之前的类似于“App.Exit()”之类的函数用来让你退出程序.这是怎么回事儿呢? 很简单,在Windows Phone 7中系统要求配备了硬件的“Back”键 ...
- 新做的H5页面(具体应该说是百分比页面)
主要代码 <div class="top" id="headTab"> <div id="photo"><a ...
- [大牛翻译系列]Hadoop 翻译文章索引
原书章节 原书章节题目 翻译文章序号 翻译文章题目 链接 4.1 Joining Hadoop(1) MapReduce 连接:重分区连接(Repartition join) http://www.c ...
- execute连接 类型
set rs=server.createobject("adodb.recordset") sql="select top 10 id,name from tablena ...
- Sql Server数据库
1.表分区 http://www.cnblogs.com/huangxincheng/p/3565755.html 2.MVP教程地址:http://www.cnblogs.com/lyhabc/p/ ...
- 万网域名解析到IP地址
进入https://home.console.aliyun.com/#/的阿里云控制台 再自己购买的域名列表里进行操作 添加一个A解析