n,i,j;\x0d main(){\x0d scanf("%d",&n);\x0d printf("Gray code n=%d\n",n);\x0d for(;i<pow(2,n);++i){\x0d for(j=n;j--;){\x0d putchar(((i^(i>>1))>>j&1)+48);\x0d }\x0d puts("");\x0d }\x0d }\x0d
Note that non-ascii characters in the above source code will be escaped (such as \x9f).