The purpose of the quiz:
Mastering the technique of random value using random
Problem-Solving requirements:
Code generic, efficient
Try to be concise.
Try not to generate temporary files
Additional rules:
1 Ideas unique benchmark points 5 points
2 code efficiency, common benchmark points 4 points
3 Skill Superb Benchmark score 3 points
4 Code concise benchmark points 2 points
5 Perfect code plus points 15 points
The topics are as follows:
1-26 is known to correspond to A-Z one by one, such as 1 corresponding to a 10 corresponding to J 26 corresponding to Z, requiring batch processing
Randomly extract 10 distinct values from the 52 values of 1-26-A-Z (all considered values) and display them,
Note that values such as 1 and a 24 and x 26 and Z are considered identical.
Problem-Solving Limitations:
Temporarily unrestricted.
Answer:
Batman
Copy Code code as follows:
@echo off&setlocal enabledelayedexpansion
For%%i in (a B c d e F g h i j k l m n o p q R S t u v w x y z) do (
set/a n+=1,a=!random!%%2
If!a! Equ 0 (
Set "_!random!! random!! Random!=%%i "
) Else (
Set "_!random!! random!! random!=!n! "
)
)
for/f "tokens=2 delims=="%%i in (' Set _ ') does (
set/a n-=1
If!n! Equ pause>nul&goto:eof
Set/p=%%i <nul
)