

Mã:
#include <bits/stdc++.h>
using namespace std;
int x[1000],n;
void nhapf(){
cin>>n;
}
void xuat(){
for(int i=1;i<=n;i++)
cout<<x[i];
cout<<endl;
}
void Try(int i){
for(int j=0;j<=1;j++){
x[i]=j;
if(i==n) xuat();
else Try(i+1);
}
}
int main(){
freopen("a.inp","r",stdin);
freopen("b.out","w",stdout);
nhapf();
Try(1);
return 0;
}
Mã:
x[i]=j;