我的代码在批处理文件中。
错误:
输入您的年龄:22
目前有50个意外。
@echo off
set /p age = "enter your age:"
if %age% leq 50 (
if %age% geq 20 (
echo "You are %age% years old in the 21st century."
) else (
echo "You are not in range."
) else (
echo "You are not in range."
)
pause
答案 0 :(得分:1)
这是脚本的更正版本。有两个问题
@echo off
set /p age="enter your age:"
if %age% leq 50 (
if %age% geq 20 (
echo "You are %age% years old in the 21st century."
) else (
echo "You are not in range."
)
) else (
echo "You are not in range."
)
pause