Notepad үүнийг бич ЭСВЭЛ ЭНД ДАРЖ ТАТ
Code
@echo off
title TOOHbI mashin eZaluus Sheeva
:starting
set /p type=XACAX NEMEH VRJIX XyBaaX SONGO:
cls
set /p fstval=Ehnii too:
cls
set /p sndval=2 dahi too:
cls
set /p moreval=Dahiad too nemeh vv? [Y/N]
if '%moreval%'== 'y' goto morevaly
if '%moreval%'== 'n' goto morevaln
if '%moreval%'== 'Y' goto morevaly
if '%moreval%'== 'N' goto morevaln
cls
:morevaly
cls
set /p thrval=Third value:
cls
set /p moreval=Dahiad too nemeh vv? [Y/N]
if '%moreval%'== 'y' goto morevaly4
if '%moreval%'== 'n' goto morevaln4x
if '%moreval%'== 'Y' goto morevaly4
if '%moreval%'== 'N' goto morevaln4x
cls
goto morevaly
:morevaly4
cls
set /p frval=Fourth value:
cls
set /p moreval=Dahiad too nemeh vv? [Y/N]
if '%moreval%'== 'y' goto morevaly5
if '%moreval%'== 'n' goto morevaln5x
if '%moreval%'== 'Y' goto morevaly5
if '%moreval%'== 'N' goto morevaln5x
cls
goto morevaly5
:morevaly5
cls
set /p fval=Fivth value:
goto morevalyy
:morevaln
set /a thrval=0
:morevaln4x
set /a frval=0
:morevaln5x
set /a fval=0
:morevalyy
if '%type%'== '+' goto addition
if '%type%'== 'addition' goto addition
if '%type%'== 'Addition' goto addition
if '%type%'== '*' goto multi
if '%type%'== 'multiplication' goto multi
if '%type%'== 'Multiplication' goto multi
if '%type%'== '-' goto min
if '%type%'== 'subtraction' goto min
if '%type%'== 'Subtraction' goto min
:addition
if '%thrval%' == '0' goto only2val
if '%frval%' == '0' goto only4val
if '%fval%' == '0' goto only5val
goto allval
:only2val
cls
echo %fstval% + %sndval% =
goto mathfin
cls
:only3val
cls
echo %fstval% + %sndval% + %thrval% =
goto mathfin
:only3val
cls
echo %fstval% + %sndval% + %thrval% + %frval% =
goto mathfin
:allval
cls
echo %fstval% + %sndval% + %thrval% + %frval% + %fval% =
:mathfin
set /a kthxbye=%fstval% + %sndval% + %thrval% + %frval% + %fval%
echo '%kthxbye%'
echo.
echo.
pause
cls
goto starting
:muti
if '%thrval%' == '0' goto multi3
if '%frval%' == '0'goto multi4
if '%fval%' == '0'goto multi5
cls
goto allvalmulti
:multi3
cls
echo %fstval% * %sndval% =
goto mathfinmulti
:multi4
cls
echo %fstval% * %sndval% * %thrval% =
goto mathfinmulti
:multi5
cls
echo %fstval% * %sndval% * %thrval% * %frval% =
goto mathfinmulti
:allvalmulti
echo %fstval% * %sndval% * %thrval% * %frval% * %fval% =
:mathfinmulti
set /a kthxbye=%fstval% * %sndval% * %thrval% * %frval% * %fval%
echo '%kthxbye%'
echo.
echo.
pause
cls
goto starting
:min
if '%thrval%' == '0' goto multi3
if '%frval%' == '0'goto multi4
if '%fval%' == '0'goto multi5
cls
goto allvalmin
:multi3
cls
echo %fstval% - %sndval% =
goto mathfinmin
:multi4
cls
echo %fstval% - %sndval% - %thrval% =
goto mathfinmin
:multi5
cls
echo %fstval% - %sndval% - %thrval% - %frval% =
goto mathfinmin
:allvalmin
echo %fstval% - %sndval% - %thrval% - %frval% - %fval% =
:mathfinmin
set /a kthxbye=%fstval% - %sndval% - %thrval% - %frval% - %fval%
echo '%kthxbye%'
echo.
echo.
pause
cls
goto starting
Та кодыг хүссэнээрээ өөрчилж болно гэдгийг санаарай
Save as---> All files , toonii mashin.bat (яаж хадгалахаа эрх биш мэдэж байгаа биз дээ)
АМЖИЛТ дараагийн дугаар хүртэл түр баяртай