哈哈 个人觉得这个方法很靠谱- @Echo Off&SetLocal EnableDelayedExpansion
- For %%A In (1 2 3 4 5 6 7 8 9) Do Set _%%A=0
- For %%A In (5 2 5 4 6 1 2 5 0 8 7 9 5 4 6 2 0 8 9 7 6 0 4 2 5 1 0 4 2 5 1 0 5 2 5 1) Do (
- If "!Is!" == "1" Set /A "_%%A+=1" & Set "Is="
- If %%A Equ 0 Set "Is=1"
- )
- Set /P Echo=0后面出现的数字:< Nul
- For /F "tokens=1,2 delims=_=" %%A In ('Set _') Do (
- Set /P Echo=%%A为%%B次,< Nul
- )
- Pause>Nul
复制代码 上面的命令执行结果为:- 0后面出现的数字:1为0次,2为0次,3为0次,4为2次,5为1次,6为0次,7为0次,8为2次,9为0次,
复制代码
|