【发布时间】:2015-01-30 00:26:52
【问题描述】:
在set /p sum=give nr %amount%: 关闭后,我找不到我的错误。
有人知道为什么吗?
无论如何谢谢;-)
::Made By QluPreX 29/01/2015
@echo off
cls
color a
:SET_NUM
set /p tot=how many numbers:
cls
set amount=1
set sum_tot=0
echo %tot%?
set /p y_or_n=is that correct (y/n) ? :
if %y_or_n%==y (
cls
goto:GIVE_NUM
) ELSE (
cls
goto:SET_NUM
)
:GIVE_NUM
set /p sum=give nr %amount%:
set /a sum_tot=%sum_tot%+%sum%
set /a amount=%amount%+1
if /I %amount%==%tot%(
goto:DISPLAY
)ELSE(
goto:GIVE_NUM
)
:DISPLAY
echo total is %sum_tot%
pause
【问题讨论】:
标签: windows debugging batch-file command-line cmd