遞歸實現全排列(dfs)

#include <iostream> int a[3] = { 0,1,2 }, c[3] = { 0 }; void dfs(int i) { if (i > 2) { for (int m = 0; m < 3; m++) std::cout << a[m]; std::cout << std::endl; } else { for (int j = 0; j <
相關文章
相關標籤/搜索