Spiral Fixed by nn

x,l,i;main(n,y,u,j){scanf("%d",&n);for(y=u=n-1;n--;x=i++%2?++l:--u)for(j=n-~n;j--;i%2?x<=l?y+=y<u:x--:x>=u?y-=y>l:x++)printf("%d%d ",x,y);}

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

download

return to the top page