圆月山庄资源网 Design By www.vgjia.com
复制代码 代码如下:
@echo off
:: 求1-100范围内随机的不同5个数值
:: 生成0-99之间的随机数列 R1
::
::
::
@echo off
setlocal EnableDelayedExpansion
:: 初始化顺序数列
for /l %%i in (0,1,99) do (
set rnum%%i=%%i
)
:: 对数列进行随机交换
for /l %%i in (0,1,99) do (
set /a rnd=!random! %% 100
call set tmp=%%rnum!rnd!%%
set rnum!rnd!=!rnum%%i!
set rnum%%i=!tmp!
)
set rnum
pause
goto :eof
@echo off
:: Code by JM 2006-1-5 CMD@XP
:begin
cls
set times=0
set count=0
:loop
set /a num=%random%%%99+1
if not defined num%num% (
set num%num%=%num%
set /a count+=1
call echo %%num%%
)
set /a times+=1
if %times% equ 20 (
for /l %%i in (1,1,99) do set num%%i=
set times=0
)
if %count% lss 5 goto loop
pause>nul
goto begin
@echo off
:: Code by JM 2007-1-6 CMD@XP
:: 因为用到了 echo|find 的结构,速度比较慢
::
:begin
cls
set count=0
:loop
set /a num=%random%%%100+1
echo %str%|find " %num% ">nul&&goto loop
call set str=%%str%% %num%
set /a count+=1
if %count% lss 5 goto loop
echo %str%
set str=
pause
goto begin
@echo off&setlocal enabledelayedexpansion
::
::
for /l %%a in (1;1;5) do (
set/a b=!random!%%99+1
call :pp !b!
)
goto :eof
:pp
if not defined %1 (set %1=a) else goto loop
echo %1
goto :eof
:loop
set/a b=!random!%%99+1
call :pp !b!
@echo off
::
::
set Max=100
set N=5
:start
cls
echo %time%
set Num=
set Tmp$=
:loop
set /a randomloop=(%random%+%random%+%random%)/3%%%Max%+1
for %%n in (%Tmp$%) do if "%randomloop%" == "%%n" goto loop
call set Tmp$=%%Tmp$%% %randomloop%
set /a Num+=1
set random_%Num%=%randomloop%
if %Num% LSS %N% goto loop
echo %Tmp$%
echo %time%
pause
goto start
exit
@echo off
::
::
:start
cls
set Num=
set Tmp$=
:loop
set /a randomloop=%random%%%99+1
for %%n in (%Tmp$%) do if "%randomloop%" == "%%n" goto loop
call set Tmp$=%%Tmp$%% %randomloop%
set /a Num+=1
set random_%Num%=%randomloop%
if %Num% LSS 5 goto loop
for /l %%n in (1,1,%Num%) do call set /p= %%random_%%n%%<nul
echo.
pause
goto start
exit
@echo off
:: 求1-100范围内随机的不同5个数值
:: 生成0-99之间的随机数列 R1
::
::
::
@echo off
setlocal EnableDelayedExpansion
:: 初始化顺序数列
for /l %%i in (0,1,99) do (
set rnum%%i=%%i
)
:: 对数列进行随机交换
for /l %%i in (0,1,99) do (
set /a rnd=!random! %% 100
call set tmp=%%rnum!rnd!%%
set rnum!rnd!=!rnum%%i!
set rnum%%i=!tmp!
)
set rnum
pause
goto :eof
@echo off
:: Code by JM 2006-1-5 CMD@XP
:begin
cls
set times=0
set count=0
:loop
set /a num=%random%%%99+1
if not defined num%num% (
set num%num%=%num%
set /a count+=1
call echo %%num%%
)
set /a times+=1
if %times% equ 20 (
for /l %%i in (1,1,99) do set num%%i=
set times=0
)
if %count% lss 5 goto loop
pause>nul
goto begin
@echo off
:: Code by JM 2007-1-6 CMD@XP
:: 因为用到了 echo|find 的结构,速度比较慢
::
:begin
cls
set count=0
:loop
set /a num=%random%%%100+1
echo %str%|find " %num% ">nul&&goto loop
call set str=%%str%% %num%
set /a count+=1
if %count% lss 5 goto loop
echo %str%
set str=
pause
goto begin
@echo off&setlocal enabledelayedexpansion
::
::
for /l %%a in (1;1;5) do (
set/a b=!random!%%99+1
call :pp !b!
)
goto :eof
:pp
if not defined %1 (set %1=a) else goto loop
echo %1
goto :eof
:loop
set/a b=!random!%%99+1
call :pp !b!
@echo off
::
::
set Max=100
set N=5
:start
cls
echo %time%
set Num=
set Tmp$=
:loop
set /a randomloop=(%random%+%random%+%random%)/3%%%Max%+1
for %%n in (%Tmp$%) do if "%randomloop%" == "%%n" goto loop
call set Tmp$=%%Tmp$%% %randomloop%
set /a Num+=1
set random_%Num%=%randomloop%
if %Num% LSS %N% goto loop
echo %Tmp$%
echo %time%
pause
goto start
exit
@echo off
::
::
:start
cls
set Num=
set Tmp$=
:loop
set /a randomloop=%random%%%99+1
for %%n in (%Tmp$%) do if "%randomloop%" == "%%n" goto loop
call set Tmp$=%%Tmp$%% %randomloop%
set /a Num+=1
set random_%Num%=%randomloop%
if %Num% LSS 5 goto loop
for /l %%n in (1,1,%Num%) do call set /p= %%random_%%n%%<nul
echo.
pause
goto start
exit
标签:
随机
圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com
暂无评论...
更新日志
2024年11月01日
2024年11月01日
- 群星.2023-非凡医者影视原声带【华纳】【FLAC分轨】
- 《寻找弗兰基》全成就一览
- 《传说法师2》EA评测:不是亲生的不心疼
- 《射戮骑士》评测:“幸存者!去杀穿硬核地狱!”
- 群星《名声(黑胶CD)》[WAV+CUE]
- 梅艳芳《女人花》SACD[原抓WAV+CUE]
- 孙露《因为想念》【WAV+CUE】
- 罗艺恒《What Could've Been》[FLAC/分轨][130.04MB]
- 罗熙楷《笼中鸟Caged Bird》[320K/MP3][72.27MB]
- 罗熙楷《笼中鸟Caged Bird》[FLAC/分轨][191.82MB]
- 英雄联盟s14晋级四强队伍是哪些 S14全球总决赛四强战队介绍
- 魔兽世界怀旧服专家模式什么时候开 怀旧服专家模式开启时间介绍
- 魔兽世界永久60级哪个职业最强 魔兽世界永久60级职业推荐
- 上海Major赛事专属版显示器首次亮相PNL高校决赛
- 寻找中国“龙” 感受乐元素的“科普力”