复制代码
- @echo off
- :cmd
- title 计算器
- :start
- set /p user_input=请选择一种运算:
- if %user_input% equ 乘法=goto a
- if %user_input% equ 除法=goto b
- if %user_input% equ 加法=goto c
- if %user_input% equ 减法=goto d
- if %user_input% equ ps=goto ps
- if %user_input% equ many=goto many
- goto start
- :a
- echo 请输入第一个因数
- set /p "A=>"
- echo 请输入第二个因数
- set /p "B=>"
- set /a result=%A%*%B%
- echo %result%
- pause
- goto start
- :b
- echo 请输入被除数
- set /p "A1=>"
- echo 请输入除数
- set /p "B1=>"
- set /a result=%A1%/%B1%
- echo %result%
- pause
- goto start
- :c
- echo 请输入第一个加数
- set /p "A2=>"
- echo 请输入第二个加数
- set /p "B2=>"
- set /a result=%A2%+%B2%
- echo %result%
- pause
- goto start
- :d
- echo 请输入被减数
- set /p "A3=>"
- echo 请输入减数
- set /p "B3=>"
- set /a result=%A3%-%B3%
- echo %result%
- pause
- goto start
- :ps
- title 计算器-PowerShell
- :psstart
- set /p user_input=请选择一种运算:
- if %user_input% equ 乘法=goto psa
- if %user_input% equ 除法=goto psb
- if %user_input% equ 加法=goto psc
- if %user_input% equ 减法=goto psd
- if %user_input% equ cmd=goto cmd
- if %user_input% equ many=goto many
- :psa
- echo 请输入第一个因数
- set /p "psA=>"
- echo 请输入第二个因数
- set /p "psB=>"
- powershell -command " ( %psA% * %psB% ) "
- pause
- goto psstart
- :psb
- echo 请输入被除数
- set /p "psA1=>"
- echo 请输入除数
- set /p "psB1=>"
- powershell -command " ( %psA1% / %psB1% ) "
- pause
- goto psstart
- :psc
- echo 请输入第一个加数
- set /p "psA2=>"
- echo 请输入第二个加数
- set /p "psB2=>"
- powershell -command " ( %psA2% + %psB2% ) "
- pause
- goto psstart
- :psd
- echo 请输入被减数
- set /p "psA3=>"
- echo 请输入减数
- set /p "psB3=>"
- powershell -command " ( %psA3% - %psB3% ) "
- pause
- goto psstart
- :many
- title 更多数字运算
- :mstart
- set /p user_input=请选择一种运算:
- if %user_input% equ 乘法=goto ma
- if %user_input% equ 除法=goto mb
- if %user_input% equ 加法=goto mc
- if %user_input% equ 减法=goto md
- if %user_input% equ ps=goto ps
- if %user_input% equ cmd=goto cmd
- goto mstart
- :ma
- set /p user_input=请输入需要运算的数字数量:
- if %user_input% equ 3=goto 1
- if %user_input% equ 4=goto 2
- if %user_input% equ 5=goto 3
- goto ma
- :1
- echo 请输入第一个因数
- set /p "mA=>"
- echo 请输入第二个因数
- set /p "mB=>"
- echo 请输入第三个因数
- set /p "mC=>"
- powershell -command " ( %mA% * %mB% * %mC%) "
- pause
- goto mstart
- :2
- echo 请输入第一个因数
- set /p "mA1=>"
- echo 请输入第二个因数
- set /p "mB1=>"
- echo 请输入第三个因数
- set /p "mC1=>"
- echo 请输入第四个因数
- set /p "mD1=>"
- powershell -command " ( %mA1% * %mB1% * %mC1% * %mD1%) "
- pause
- goto mstart
- :3
- echo 请输入第一个因数
- set /p "mA2=>"
- echo 请输入第二个因数
- set /p "mB2=>"
- echo 请输入第三个因数
- set /p "mC2=>"
- echo 请输入第四个因数
- set /p "mD2=>"
- echo 请输入第五个因数
- set /p "mE2=>"
- powershell -command " ( %mA2% * %mB2% * %mC2% * %mD2% * %mE2%) "
- pause
- goto mstart
- :mb
- set /p user_input=请输入需要运算的数字数量:
- if %user_input% equ 3=goto 1a
- if %user_input% equ 4=goto 2a
- if %user_input% equ 5=goto 3a
- goto mb
- :1a
- echo 请输入被除数
- set /p "mmA=>"
- echo 请输入第一个除数
- set /p "mmB=>"
- echo 请输入第二个除数
- set /p "mmC=>"
- powershell -command " ( %mmA% / %mmB% / %mmC%) "
- pause
- goto mstart
- :2a
- echo 请输入被除数
- set /p "mmA1=>"
- echo 请输入第一个除数
- set /p "mmB1=>"
- echo 请输入第二个除数
- set /p "mmC1=>"
- echo 请输入第三个除数
- set /p "mmD1=>"
- powershell -command " ( %mmA1% / %mmB1% / %mmC1% / %mmD1%) "
- pause
- goto mstart
- :3a
- echo 请输入被除数
- set /p "mmA2=>"
- echo 请输入第一个除数
- set /p "mmB2=>"
- echo 请输入第二个除数
- set /p "mmC2=>"
- echo 请输入第三个除数
- set /p "mmD2=>"
- echo 请输入第四个除数
- set /p "mmE2=>"
- powershell -command " ( %mmA2% / %mmB2% / %mmC2% / %mmD2% / %mmE2%) "
- pause
- goto mstart
- :mc
- set /p user_input=请输入需要运算的数字数量:
- if %user_input% equ 3=goto 1b
- if %user_input% equ 4=goto 2b
- if %user_input% equ 5=goto 3b
- goto mc
- :1b
- echo 请输入第一个加数
- set /p "mmmA=>"
- echo 请输入第二个加数
- set /p "mmmB=>"
- echo 请输入第三个加数
- set /p "mmmC=>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC%) "
- pause
- goto mstart
- :2b
- echo 请输入第一个加数
- set /p "mmmA=>"
- echo 请输入第二个加数
- set /p "mmmB=>"
- echo 请输入第三个加数
- set /p "mmmC=>"
- echo 请输入第四个加数
- set /p "mmmD=>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD%) "
- pause
- goto mstart
- :3b
- echo 请输入第一个加数
- set /p "mmmA=>"
- echo 请输入第二个加数
- set /p "mmmB=>"
- echo 请输入第三个加数
- set /p "mmmC=>"
- echo 请输入第四个加数
- set /p "mmmD=>"
- echo 请输入第五个加数
- set /p "mmmE=>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD% + %mmmE%) "
- pause
- goto mstart
- :md
- set /p user_input=请输入需要运算的数字数量:
- if %user_input% equ 3=goto 1c
- if %user_input% equ 4=goto 2c
- if %user_input% equ 5=goto 3c
- goto md
- :1c
- echo 请输入被减数
- set /p "mmmmA=>"
- echo 请输入第一个减数
- set /p "mmmmB=>"
- echo 请输入第二个减数
- set /p "mmmmC=>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC%) "
- pause
- goto mstart
- :2c
- echo 请输入被减数
- set /p "mmmmA=>"
- echo 请输入第一个减数
- set /p "mmmmB=>"
- echo 请输入第二个减数
- set /p "mmmmC=>"
- echo 请输入第三个减数
- set /p "mmmmD=>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD%) "
- pause
- goto mstart
- :3c
- echo 请输入被减数
- set /p "mmmmA=>"
- echo 请输入第一个减数
- set /p "mmmmB=>"
- echo 请输入第二个减数
- set /p "mmmmC=>"
- echo 请输入第三个减数
- set /p "mmmmD=>"
- echo 请输入第四个减数
- set /p "mmmmE=>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD% - %mmmmE%) "
- pause
- goto mstart
复制代码
- @echo off
- :cmd
- title Calculator
- :start
- cls
- echo ---------------------
- echo MICRODOS CALCULATOR
- echo ---------------------
- echo.
- echo 1.Multiplication
- echo.
- echo 2.Division
- echo.
- echo 3.Addition
- echo.
- echo 4.Subtraction
- echo.
- echo 5.Decimal Calculate
- echo.
- echo 6.Multiple Number Calculation
- echo.
- echo Q.Exit
- echo.
- set /p user_input=Please select an operation:
- if %user_input% equ 1=goto a
- if %user_input% equ 2=goto b
- if %user_input% equ 3=goto c
- if %user_input% equ 4=goto d
- if %user_input% equ 5=goto ps
- if %user_input% equ 6=goto many
- if /i "%user_input%"=="Q" exit /b
- cls
- echo ERROR!
- pause>nul
- goto start
- :a
- cls
- echo Please enter the first factor.
- set /p "A=>>>"
- echo Please enter the second factor.
- set /p "B=>>>"
- set /a result=%A%*%B%
- echo %result%
- pause
- goto start
- :b
- cls
- echo Please enter dividend.
- set /p "A1=>>>"
- echo Please enter a divisor.
- set /p "B1=>>>"
- set /a result=%A1%/%B1%
- echo %result%
- pause
- goto start
- :c
- cls
- echo Please enter the first addend.
- set /p "A2=>>>"
- echo Please enter the second addend.
- set /p "B2=>>>"
- set /a result=%A2%+%B2%
- echo %result%
- pause
- goto start
- :d
- cls
- echo Please enter the minuend.
- set /p "A3=>>>"
- echo Please enter a reduction.
- set /p "B3=>>>"
- set /a result=%A3%-%B3%
- echo %result%
- pause
- goto start
- :ps
- title Calculator-PowerShell
- :psstart
- cls
- echo ---------------------
- echo MICRODOS CALCULATOR
- echo ---------------------
- echo.
- echo 1.Multiplication
- echo.
- echo 2.Division
- echo.
- echo 3.Addition
- echo.
- echo 4.Subtraction
- echo.
- echo 5.Integer calculation
- echo.
- echo Q.Exit
- echo.
- set /p user_input=Please select an operation:
- if %user_input% equ 1=goto psa
- if %user_input% equ 2=goto psb
- if %user_input% equ 3=goto psc
- if %user_input% equ 4=goto psd
- if %user_input% equ 5=goto cmd
- if /i "%user_input%"=="Q" exit /b
- cls
- echo ERROR!
- pause>nul
- goto pssstart
- :psa
- cls
- echo Please enter the first factor.
- set /p "psA=>>>"
- echo Please enter the second factor
- set /p "psB=>>>"
- powershell -command " ( %psA% * %psB% ) "
- pause
- goto psstart
- :psb
- cls
- echo Please enter dividend.
- set /p "psA1=>>>"
- echo Please enter a divisor.
- set /p "psB1=>>>"
- powershell -command " ( %psA1% / %psB1% ) "
- pause
- goto psstart
- :psc
- cls
- echo Please enter the first addend.
- set /p "psA2=>>>"
- echo Please enter the second addend.
- set /p "psB2=>>>"
- powershell -command " ( %psA2% + %psB2% ) "
- pause
- goto psstart
- :psd
- cls
- echo Please enter the minuend.
- set /p "psA3=>>>"
- echo Please enter a reduction.
- set /p "psB3=>>>"
- powershell -command " ( %psA3% - %psB3% ) "
- pause
- goto psstart
- :many
- title Calculator-More Calculate Way
- :mstart
- cls
- echo ---------------------
- echo MICRODOS CALCULATOR
- echo ---------------------
- echo.
- echo 1.Multiplication
- echo.
- echo 2.Division
- echo.
- echo 3.Addition
- echo.
- echo 4.Subtraction
- echo.
- echo 5.Decimal Calculate
- echo.
- echo 6.Multiple Number Calculation
- echo.
- echo Q.Exit
- echo.
- set /p user_input=Please select an operation:
- if %user_input% equ 1=goto ma
- if %user_input% equ 2=goto mb
- if %user_input% equ 3=goto mc
- if %user_input% equ 4=goto md
- if %user_input% equ 5=goto ps
- if %user_input% equ 6=goto cmd
- if /i "%user_input%"=="Q" exit /b
- cls
- echo ERROR!
- pause>nul
- goto mstart
- :ma
- cls
- echo.
- echo Up to 5 numbers can be calculated simultaneously.
- echo.
- echo You can choose a number calculation between 3-5
- echo.
- set /p user_input=Please enter the number of numbers to be calculated:
- if %user_input% equ 3=goto 1
- if %user_input% equ 4=goto 2
- if %user_input% equ 5=goto 3
- goto ma
- :1
- cls
- echo Please enter the first factor.
- set /p "mA=>>>"
- echo Please enter the second factor.
- set /p "mB=>>>"
- echo Please enter the third factor.
- set /p "mC=>>>"
- powershell -command " ( %mA% * %mB% * %mC%) "
- pause
- goto mstart
- :2
- cls
- echo Please enter the first factor
- set /p "mA1=>>>"
- echo Please enter the second factor
- set /p "mB1=>>>"
- echo Please enter the third factor
- set /p "mC1=>>>"
- echo Please enter the fourth factor
- set /p "mD1=>>>"
- powershell -command " ( %mA1% * %mB1% * %mC1% * %mD1%) "
- pause
- goto mstart
- :3
- cls
- echo Please enter the first factor
- set /p "mA2=>>>"
- echo Please enter the second factor
- set /p "mB2=>>>"
- echo Please enter the third factor
- set /p "mC2=>>>"
- echo Please enter the fourth factor
- set /p "mD2=>>>"
- echo Please enter the fifth factor
- set /p "mE2=>>>"
- powershell -command " ( %mA2% * %mB2% * %mC2% * %mD2% * %mE2%) "
- pause
- goto mstart
- :mb
- cls
- echo.
- echo Up to 5 numbers can be calculated simultaneously.
- echo.
- echo You can choose a number calculation between 3-5
- echo.
- set /p user_input=Please enter the number of numbers to be calculated:
- if %user_input% equ 3=goto 1a
- if %user_input% equ 4=goto 2a
- if %user_input% equ 5=goto 3a
- goto mb
- :1a
- cls
- echo Please enter the divisor
- set /p "mmA=>>>"
- echo Enter the first divisor
- set /p "mmB=>>>"
- echo Enter the second divisor
- set /p "mmC=>>>"
- powershell -command " ( %mmA% / %mmB% / %mmC%) "
- pause
- goto mstart
- :2a
- cls
- echo Please enter the divisor
- set /p "mmA1=>>>"
- echo Enter the first divisor
- set /p "mmB1=>>>"
- echo Enter the second divisor
- set /p "mmC1=>>>"
- echo Enter the third divisor
- set /p "mmD1=>>>"
- powershell -command " ( %mmA1% / %mmB1% / %mmC1% / %mmD1%) "
- pause
- goto mstart
- :3a
- cls
- echo Please enter the divisor
- set /p "mmA2=>>>"
- echo Enter the first divisor
- set /p "mmB2=>>>"
- echo Enter the second divisor
- set /p "mmC2=>>>"
- echo Enter the third divisor
- set /p "mmD2=>>>"
- echo Enter the fourth divisor
- set /p "mmE2=>>>"
- powershell -command " ( %mmA2% / %mmB2% / %mmC2% / %mmD2% / %mmE2%) "
- pause
- goto mstart
- :mc
- cls
- echo.
- echo Up to 5 numbers can be calculated simultaneously.
- echo.
- echo You can choose a number calculation between 3-5
- echo.
- set /p user_input=Please enter the number of numbers to be calculated:
- if %user_input% equ 3=goto 1b
- if %user_input% equ 4=goto 2b
- if %user_input% equ 5=goto 3b
- goto mc
- :1b
- cls
- echo Please enter the first addition
- set /p "mmmA=>>>"
- echo Please enter the second addition
- set /p "mmmB=>>>"
- echo Please enter the third addition
- set /p "mmmC=>>>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC%) "
- pause
- goto mstart
- :2b
- cls
- echo Please enter the first addition
- set /p "mmmA=>>>"
- echo Please enter the second addition
- set /p "mmmB=>>>"
- echo Please enter the third addition
- set /p "mmmC=>>>"
- echo Please enter the fourth addition
- set /p "mmmD=>>>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD%) "
- pause
- goto mstart
- :3b
- cls
- echo Please enter the first addition
- set /p "mmmA=>>>"
- echo Please enter the second addition
- set /p "mmmB=>>>"
- echo Please enter the third addition
- set /p "mmmC=>>>"
- echo Please enter the fourth addition
- set /p "mmmD=>>>"
- echo Please enter the fifth addition
- set /p "mmmE=>>>"
- powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD% + %mmmE%) "
- pause
- goto mstart
- :md
- cls
- echo.
- echo Up to 5 numbers can be calculated simultaneously.
- echo.
- echo You can choose a number calculation between 3-5
- echo.
- set /p user_input=Please enter the number of numbers to be calculated:
- if %user_input% equ 3=goto 1c
- if %user_input% equ 4=goto 2c
- if %user_input% equ 5=goto 3c
- goto md
- :1c
- cls
- echo Please enter the minus
- set /p "mmmmA=>>>"
- echo Please enter the first minus
- set /p "mmmmB=>>>"
- echo Please enter the second minus
- set /p "mmmmC=>>>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC%) "
- pause
- goto mstart
- :2c
- cls
- echo Please enter the minus
- set /p "mmmmA=>>>"
- echo Please enter the first minus
- set /p "mmmmB=>>>"
- echo Please enter the second minus
- set /p "mmmmC=>>>"
- echo Please enter the third minus
- set /p "mmmmD=>>>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD%) "
- pause
- goto mstart
- :3c
- cls
- echo Please enter the minus
- set /p "mmmmA=>>>"
- echo Please enter the first minus
- set /p "mmmmB=>>>"
- echo Please enter the second minus
- set /p "mmmmC=>>>"
- echo Please enter the third minus
- set /p "mmmmD=>>>"
- echo Please enter the fourth minus
- set /p "mmmmE=>>>"
- powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD% - %mmmmE%) "
- pause
- goto mstart
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |