我写的很明白 额
你把最后循环改
@echo off
setlocal enabledelayedexpansion
for /l %%a in (1,1,30) do (set number%%a=%%a)
for /l %%a in (30,-1,1) do (
set /a rand=!random! %% %%a + 1
set /a new%%a=number!rand!,TempNum=number!rand!
set /a number!rand!=number%%a,number%%a=TempNum
)
for /l %%a in (1,1,10) do echo,!new%%a!
pause
输出10个就可以了
我最后那个循环次数写过了,相信你也明白哈!