标签:
//全排列问题 void Perm(string list, int i) { if (i == list.length()) { for (int c = 0; c < list.length(); c++) { cout << list.at(c) << " "; } cout << "\n"; } else { for (int j = i; j < list.length(); j++) { swap(list.at(i), list.at(j)); Perm(list,i+1); swap(list.at(i),list.at(j)); } } }
标签:
原文地址:http://www.cnblogs.com/liuhg/p/PermSolution.html