[英]Cannot find bug in simple .CMD file
set /p sum=give nr %amount%:
后,我找不到我的錯誤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
不知道您通過set /p sum=give nr %amount%:
是什么意思set /p sum=give nr %amount%:
但
)ELSE(
一定是
) ELSE (
(需要空格)
相等,
if /I %amount%==%tot%(
一定是
if /I %amount%==%tot% (
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.