- @echo off
- :loop
- (
- setlocal enabledelayedexpansion
- set /a max=!random!,x=max
- for /l %%a in (0 1 9) do set x=!x:%%a= %%a !&set ".%%a="
- for %%a in (!x!) do (
- if defined .%%a set flag=a
- set .%%a=a
- )
- if defined flag (echo !max! 有重复数字) else echo !max! 没有重复数字
- )
- endlocal&pause>nul&goto loop
复制代码
|