Gray code by yuyarin

i,j;main(n){printf("Gray code  n=%d",n=getchar()-48);for(;puts(""),i<1<<n;i++)for(j=n;j--;printf("%d",(i^i>>1)>>j&1));}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page