N Queens by funnything

n,j,v[9];main(p,i){scanf("%d",&n);for(i=0;i++<n;p>n?printf("%d%c",v[i]-1,i<n?32:10):j||main(p+1,v[p]=i))for(j=p;--j&&v[j]-i&&abs(v[j]-i)-p+j;);}

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

download

return to the top page