新手入門—遞歸實現指數型枚舉

題目意思簡而言之是將{1,2,3……n}中全部的真子集輸出出來。 代碼以下 #include<bits/stdc++.h> using namespace std; int n,i; int arr[20]; void dfs(int cur,int m){ if(cur==n+1){ for(i=1;i<m;++i){ cout<<arr[i]<<" "; } puts("
相關文章
相關標籤/搜索