以下代码不起作用。无论我输入什么都只会返回一个错误,然后返回到Retry
.
@echo off
:maths
set /p Mathsa="first number? "
echo your first number is %Mathsa%
:retry
set /p Mathso="operator?(+-*/) "
if "%Mathso%" ==* GOTO run
if "%Mathso%" ==/ GOTO run
if "%Mathso%" ==+ GOTO run
if "%Mathso%" ==- GOTO run
echo Error, wrong operator. & goto retry
:run
set /p Mathsb="Second Number? "
set /a Mathsans=%Mathsa%%Mathsp%%Mathsb%
echo %Mathsans%
pause
我完全不知道它为什么这样做。这是一个学校项目,您可以提供的任何帮助将不胜感激!