骗分- @echo off&Setlocal EnableDelayedExpansion
- Set /p N=num:
- Set /a ALL=N*N,w=0,h=w,s=h,c=s,l=n-1
- For /l %%a in (1,1,%all%) Do (Set _o!h!!w!=%%a
- if !c! EQU 0 (call :c w + GEQ 1 "l-s") else if !c! EQU 1 (call :c h + GEQ 2 "l-s"
- ) else if !c! EQU 2 (call :c w - LEQ 3 "s") else if !c! EQU 3 call :c h - LEQ "0,s+=1" "s+1")
- for /f "tokens=1,2 delims==" %%a in ('set _o^|sort') do (
- Set/P=%%b <nul&Set /a count+=1,1/^(count%%%N%^)2>nul||echo.)
- pause >nul&goto :eof
- :c
- Set /a %1%2=1,tmp=%~5
- if !%1! %3 %tmp% Set /a %1=tmp,c=%~4
- goto :eof
复制代码
|