n=input() i=0 print"Gray code n="+`n` while i<2**n:s="";g=i^i/2;exec"s=`g&1`+s;g/=2;"*n;print s;i+=1
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page