How to randomly select values for batch processing
This article mainly shows you "how to take values randomly in batch processing". The content is simple and clear. I hope it can help you solve your doubts. Next, let me lead you to study and learn the article "how to take values randomly in batch processing".
The one with the problem:
Master the skill of random value selection by using random
Problem solving requirements:
The code is universal and efficient.
Keep it as simple as possible
Try not to generate temporary files
Bonus points rule:
1 unique benchmark score of 5 points
2 code efficiency, general benchmark score 4 points
3 skill superb benchmark score 3 points
4 code simplicity benchmark score 2 points
5 perfect code plus 15 points
The topics are as follows:
It is known that there is an one-to-one correspondence between 1-26 and aMuz. For example, 1 corresponds to a 10 corresponds to j 26 corresponds to z, and batch processing is required.
Ten different values are randomly selected from the 52 values (all regarded as values) from 1mur26aMuz and displayed.
Note that values such as 1 and a 24 and x 26 and z are considered the same non-compliant.
Problem solving restrictions:
There is no limit for the time being.
Answer:
The code is 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 / an + = 1% 2
If! a! Equ 0 (
Set "_! I"
) else (
Set "_! I don't know what to do."
)
)
For / f "tokens=2 delims=="% I in ('set _') do (
Set / a nmurf 1
If! n! Equ 15 pause > nul&goto: eof
Set / packs%% I