我的一个朋友让我编写一个程序,该程序可以像矩阵一样打印一串随机的 1 和 0。我同意并成功地批量编写了一个程序,该程序具有所需的输出,但运行速度有点慢,我想知道是否有办法让它更高效
set count=0
:loopassign
if %count%==80 goto show
set/a count=%count%+1
set/a value=%random% %% 2
set number%count%=%value%
goto loopassign
:show
echo { %number1%%number2%%number3%%number4%%number5%%number6%%number7%%number8%%number9%%number10%%number11%%number12%%number13%%number14%%number15%%number16%%number17%%number18%%number19%%number20%%number21%%number23%%number24%%number25%%number26%%number27%%number28%%number29%%number30%%number31%%number32%%number33%%number43%%number44%%number45%%number46%%number47%%number48%%number49%%number50%%number51%%number52%%number53%%number54%%number55%%number56%%number57%%number58%%number59%%number60%%number61%%number62%%number63%%number64%%number65%%number66%%number67%%number68%%number69%%number70%%number71%%number72%%number73%%number74%%number75%%number76%%number77%%number78%%number79%%number80% }
set count=0
goto loopassign