Problem A : STEED Cards
From: DHUOJ, 2017060301
(Out of Contest)
题目意思就是输出STEED的所有全排列,用全排列函数来处理即可
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int n;
string ch[65];
string s="STEED";
sort(s.begin(),s.end());
int count1=0;
ch[++count1]=s;
while(next_permutation(s.begin(),s.end()))
{
ch[++count1]=s;
if(count1>60)
break;
}
while(scanf("%d",&n)!=EOF)
{
cout<<ch[n]<<endl;
}
return 0;
}