Gray code by 7gyou

j;main(k){for(printf("Gray code  n=%d",k=atoi(gets())),k++;j<k<<k-1;++j)putchar(j%k?"0110"[j/k>>k-j%k-1&3]:10);}

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

download

return to the top page