摘要: 全排列算法:#include<iostream>using namespace std;template <class Type>void Perm(Type list[], int k, int m){ if(k==m) { for(int i=0; i<=m; i++) cout << list[i]; cout << endl; } else for(int j=k; j<=m; j++) { Swap(list[k],list[j]); Perm(list, k+1, m); Swap(list[k],list[j]); }} 阅读全文
posted @ 2012-04-05 20:53 ☆A希亿 阅读(738) 评论(0) 推荐(0) 编辑