帝尊 当前离线
一级士官
hfxiang 当前离线
上尉
@echo off setlocal enabledelayedexpansion set "str1=1234567890ABCDF" for /l %%i in (1,1,9) do ( set /a r=!random!%%15 call set "str2=!str2!%%str1:~!r!,1%%" ) echo;str=%str2% endlocal复制代码
TOP
qixiaobin0715 当前离线
大校
@echo off set n=15 set var=1234567890ABCDEFG setlocal enabledelayedexpansion for /l %%i in (1,1,9) do ( set /a m=!random!%%n for %%j in (!m!) do ( set str1=!var:~%%j,1! set str2=!str2!!str1! ) set /a n-=1 for %%k in (!str1!) do set var=!var:%%k=! ) echo,!str2! pause复制代码
hfxiang 发表于 2022-10-11 10:52
要求不重复取值可以这样: qixiaobin0715 发表于 2022-10-11 12:21