51Nod - 1384

全排列函数解法

#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <queue> #include <stack> using namespace std; typedef long long ll; char s[15]; int main() { int len; scanf("%s", s); len=strlen(s); sort(s,s+len); do { puts(s); }while(next_permutation(s, s+len)); return 0; }

猜你喜欢

转载自www.cnblogs.com/nr1999/p/9052624.html