kofbld 当前离线
上等兵
@echo off :loop set /a r=%random%%%10+1 for /f %%i in (c:\test.txt) do ( if %r%==%%i ( goto loop ) else ( goto next ) pause ) :next echo %r%>>c:\test.txt pause复制代码
评分人数
pcl_test 当前离线
荣誉版主
TOP
@echo off >c:\test.txt echo 零 :loop set n=0 set /a r=%random%%%10+1 for /f %%i in (c:\test.txt) do ( if %r%==%%i set n=1 ) if %n% == 0 (goto next) else (goto loop) :next >>c:\test.txt echo %r% pause复制代码
@echo off :loop set /a r=%random%%%10+1 find "%r%" "c:\test.txt" >nul &&goto loop ||goto next :next >>c:\test.txt echo %r% pause复制代码