netdzb 当前离线
上尉
newswan 当前离线
TOP
Gin_Q 当前离线
五级士官
>>> import random >>> a = list(range(1,20)) >>> a [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] >>> random.shuffle(a) >>> a [5, 14, 4, 6, 1, 12, 11, 13, 7, 3, 17, 10, 16, 8, 18, 19, 15, 9, 2] >>> 复制代码
qixiaobin0715 当前在线
大校
@echo off setlocal enabledelayedexpansion for /l %%a in (1,1,!n!) do set #!random!=%%a for /f "tokens=2 delims==" %%i in ('set #') do echo,%%i pause复制代码
for /f "usebackq delims=" %%a in (`dir /b *.txt`) do ( call :f "%%a" ) for /f "usebackq tokens=2 delims==" %%a in (`set _`) do ( echo %%a ) goto :END :f set n=%random% if defind _%n% goto :f set _%n%=%~1 goto :eof复制代码