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