//全排列问题 void Perm(string list, int i) { if (i == list.length()) { for (int c = 0; c < list.length(); c++) { cout << list.at(c) << " "; } cout << " "; } 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)); } } }