Magic Square is also known as Rubik's Cube, square squares or halls. In a square consisting of a number of neatly arranged numbers, the sum of the numbers of any one row, one longitudinal line, and the diagonal is equal, and a chart of this nature, called Magic Square,
Ancient China called "river Map", "Luo Shu", also known as "vertical and horizontal map." Code as follows: @echo off:start set/p n=please input your odd integer:set/a p=n%%2 if%p% equ 0 echo Input error!&&am P;goto start set/a i=%n% set/a t= (%n%+1)/2 set/a a%t%_%n%=1,temp=1,m=n-1,p=n:repeat set/a p-=1 if%p% LSS 0 go To array for/l%%a on (1 1%m%) do ( setlocal enabledelayedexpansion if!t! GTR%n% set/a t=1 if!i! GTR%n% set/a i=1 set/a s=!t!+1,q=!i!+1 if!s! GTR%n% set/a S=1 if!q! GTR%n% set/a q=1 set/a a!s!_!q!=a!t!_!i!+1,t+=1,i+=1 set/a temp+=1 if!temp! Equ%n% ( set/a temp=1,tmp=a!s!_!q!,q-=1,i-=1 if!q! Equ 0 set/a q=n set/a a!s!_!q!=tmp+1 goto repeat) & nbsp; ) Pause:array echo now behold the powerful Magic sqaure^^!: set/a a!t!_!n!=1 for/l%%c in (!n!-1 1 Do ( for/l%%d in (1 1!n!) do ( set/a result=a%%d_% %c Set/p=!result!<nul ) echo. ) Pause>nul