首页 > 其他 > 详细

NYOJ366 D的小L next_permutation函数的用法

时间:2014-03-04 13:21:12      阅读:483      评论:0      收藏:0      [点我收藏+]

原题链接


#include <iostream>
#include <algorithm>
using namespace std;
char str[10];

int main(){
	int t, n;
	cin >> t;
	while(t--){
		cin >> n;
		for(int i = 1; i <= n; ++i)
			str[i - 1] = i + ‘0‘;
		str[n] = ‘\0‘;
		do{
			cout << str << endl;
		}while(next_permutation(str, str + n));
	}
	return 0;
}


NYOJ366 D的小L next_permutation函数的用法,布布扣,bubuko.com

NYOJ366 D的小L next_permutation函数的用法

原文:http://blog.csdn.net/chang_mu/article/details/20388583

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!