我目前正在使用批处理代码。我需要创建一个脚本,询问用户需要运行多少次循环。在此循环中,程序将询问用户数字,并且这些数字需要添加到全局数组中。我会发布一些伪代码。
@echo off
set /p d=How many times will this loop?
cls
for /L %%a in (1,1,%d%) do (
set /p code=Input code:
Set codes[%%a]=!code!
)
我的目标是让它在运行了所需数量的循环后将所有代码粘贴到.txt文件中。
生成的.txt文件看起来像这样:
input1
input2
input3
input4
等等等等。 .txt中的输入数与开头的循环数一样多。