Magic square by nn

#import<ios>
int i,j,n;main(){for(scanf("%d",&n);j||i++<(j=n);)printf("%3d%c",(i+2*j)%n*n+(i+j+n/2)%n+1,--j?32:10);}

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

download

return to the top page