『第 6 楼』:
使用 LLM 解释/回答一下
这个是判断一个输入是否存在:
@echo off
setlocal
set /p a=判断输入的字符是否在范围之内:
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
echo %b%|findstr /i "%a%" >nul&&echo 您输入的正确||echo 对不起同志,您输入日期或星期不存在
endlocal
这个是判断连续输入三个的判断,例如:判断 1,6,9是否正确
@echo off
setlocal
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
set /p a=判断输入的字符是否在范围之内:
for /f "tokens=1,2,3 delims=," %%a in ("%a%") do (
echo %b%|findstr /i "%%a" >nul&&echo %b%|findstr /i "%%b" >nul&&echo %b%|findstr /i "%%c" >nul&&echo 您输入正确||echo 您输入
错误
)
endlocal
暂时是这样的情况,局限性太大了,不过看能否在简化或者增加判断的能力
This is to judge whether an input exists:
@echo off
setlocal
set /p a=Judge whether the entered character is within the range:
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
echo %b%|findstr /i "%a%" >nul&&echo Your input is correct||echo I'm sorry comrade, the date or week you entered does not exist
endlocal
This is to judge the judgment of continuous input of three, for example: judge whether 1,6,9 is correct
@echo off
setlocal
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
set /p a=Judge whether the entered character is within the range:
for /f "tokens=1,2,3 delims=," %%a in ("%a%") do (
echo %b%|findstr /i "%%a" >nul&&echo %b%|findstr /i "%%b" >nul&&echo %b%|findstr /i "%%c" >nul&&echo You input correctly||echo You input
wrong
)
endlocal
This is the current situation, the limitation is too big, but see if it can be simplified or increase the judgment ability
|