取到一个剔除一个
- @echo off&setlocal enabledelayedexpansion
- set "str=a b c d e f g h i j k l m n o p q r s t u v w x y z "
- for %%i in (%str%) do (set/a #+=1,%%i=#)
- for /l %%a in (1,1,10) do (
- set/a asc=!random!%%#*2,#-=1
- for %%b in (!asc!) do (set asc=!str:~%%b,1!)
- for %%b in (!asc!) do (set str=!str:%%b =!&set/a $=!random!%%2,1/$ 2>nul||set asc=!%%b!)
- echo !asc!
- )
- pause
复制代码
|