applba 当前离线
中校
TOP
terse 当前离线
中将
batman 当前离线
考官
荣誉版主
@echo off&setlocal enabledelayedexpansion for /l %%a in (1,1,500) do set "str=!str! !random!-%%a" echo !str! for /l %%a in (1,1,250) do ( for %%a in (!str!) do ( for /f "tokens=1,2 delims=-" %%b in ("%%a") do ( for %%d in (max min) do ( if not defined %%d ( set /a %%d=%%b ) else ( if %%d equ max if %%b gtr !%%d! set /a %%d=%%b if %%d equ min if %%b lss !%%d! set /a %%d=%%b ) ) ) ) for %%a in (max min) do ( for %%b in (!str!) do ( for /f "tokens=1,2 delims=-" %%c in ("%%b") do ( if %%c equ !%%a! ( set "str=!str: %%b=!" if %%a equ max set "_%%a=%%c !_%%a!" if %%a equ min set "_%%a=!_%%a! %%c" ) ) ) set "%%a=" ) ) echo %_min:~1% %_max:~1% pause>nul复制代码
@echo off&setlocal enabledelayedexpansion set n=500 for /l %%i in (1,1,!n!) do set /a _%%i=!random! for /l %%i in (1,1,!n!) do ( set /a m=%%i+1 for /l %%j in (!m!,1,!n!) do if !_%%i! gtr !_%%j! set/a _%%j=_%%i,_%%i=!_%%j! echo !_%%i! ) pause复制代码