Gray code by knct-cs

i;main(j){for(printf("Gray code  n=%d\n",j=getchar()-48),j++;j!=i>>j-1;putchar(-~i%j?48|1&(i/j^i/j>>1)>>j-2-i%j:10),i++);}

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

download

return to the top page