题解 | #全排列#
全排列
https://www.nowcoder.com/practice/5632c23d0d654aecbc9315d1720421c1
#include <cstdio> #include <algorithm> #include<string> using namespace std; int main() { string s; char arr[7]; while (scanf("%s",arr) != EOF) { string s = arr; printf("%s\n",s.c_str()); for (s.begin(); next_permutation(s.begin(), s.end());) { printf("%s\n",s.c_str()); } printf("\n"); } return 0; }