…
include[HTML_REMOVED]
using namespace std;
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
int n;
const int N = 16;
int st[N];
void dfs(int a)
{
if(a > n )
{
for(int i = 1; i <= n; i++)
{
if(st[i] == 1)
{
printf(“%d “,i);
}
}
printf(“\n”);
return;
}
st[a] = 1;
dfs(a+1);
st[a] = 2;
dfs(a+1);
}
int main()
{
cin >> n;
dfs(1);
system("pause");
return 0;
}
…