i;n;main(j){scanf("%d",&n);printf("Gray code n=%d\n",n);for(;i<1<<n;i++)for(j=n;j;)printf(j?"%d":"%d\n",((i^i>>1)>>--j)%2);}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page