gpt4 book ai didi

batch-file - 如果数字在一定范围内,则执行(此处命令)

转载 作者:行者123 更新时间:2023-12-02 17:43:25 25 4
gpt4 key购买 nike

我想问你一个问题。

我正在创建一个简单的程序来扫描数字(人们的成绩)并检查它们是否在某个范围内(比如 75% 到 90%),如果它们在某个范围内,请执行以下命令;这是代码。

(更多文字在代码下方)

@echo off
color a
title Happy Factor Decoder
echo Hello!
set /p eg="Exam Grade (RAW): "
set /p teg="TOTAL RAW Exam Grade (The highest score): "
echo Calculating
set /a m=%teg% - %eg%
echo You had %m% mistakes
echo Breaking down...
timeout /t 1 >nul
set /a bdf1=%eg% / 4
echo %bdf1%
set /a bdf2=%teg% / 4
echo %bdf2%
set /a bdf3=%m% / 4
echo %bdf3%
echo I BROKE IT DOWN YEAH :D
if %eg% == 4 goto happy
if %eg% == 3 goto kindahappy
if %eg% == 2 goto kindasad
if %eg% == 1 goto sad

:happy
echo Your father will be happy about this
pause

:kindahappy
echo Your father will be KINDA happy about this
pause

:kindasad
echo Your father will be KINDA sad about this
pause

:sad
echo Your father will be sad about this
pause

你看,我想让它做的是这个(伪代码)

IF BDF1 IS AT CERTAIN RANGE (80-90) GOTO HAPPY

有什么想法吗?

最佳答案

一个numbermin 之间和 max只是number>=max AND number<=min ,对吗???

IF %BDF1% GEQ 80 IF %BFD1% LEQ 90 GOTO :HAPPY

关于batch-file - 如果数字在一定范围内,则执行(此处命令),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17855529/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com