permutation求全排列

include <iostream>
#include <string> using namespace std; void swap(char &c1, char &c2){
char tmp = c1;
c1= c2;
c2= tmp;
} void perm(string s, int i, int n){ if(i== n){
cout << s << endl;
} for(int j=i;j<=n;j++){
swap(s[i], s[j]);
perm(s, i+, n);
swap(s[i], s[j]);
} } int main(){ string p= "";
perm(p, , ); }
上一篇:Go之viper配置


下一篇:移动端300毫秒事件响应延迟解决方法[fastclick]