|
|
本帖最后由 lovekix 于 2026-11-18 20:14 编辑
- @echo off
- :loop
- chcp 65001 >nul
- echo 请输入总场次:
- set /p "num1="
- echo 请输入胜率(直接填数字,例如 40 代表40%%):
- set /p "num2="
- set "formula_total=%num1% - 2 * %num1% * %num2% / 100"
- set "formula_lose=%num1% * %num2% / 100"
- set "formula_win=%num1% * (100 - %num2%) / 100"
- powershell -NoProfile -Command "%formula_total%" > _tmp1.txt
- powershell -NoProfile -Command "%formula_lose%" > _tmp2.txt
- powershell -NoProfile -Command "%formula_win%" > _tmp3.txt
- set /p "res_total=" < _tmp1.txt
- set /p "res_lose=" < _tmp2.txt
- set /p "res_win=" < _tmp3.txt
- del /f /q _tmp1.txt _tmp2.txt _tmp3.txt
- echo.
- echo =====================计算结果=====================
- echo 胜率:%num2%%%
- echo 净胜场次:%formula_total% = %res_total%
- echo 胜 场 数:%formula_lose% = %res_lose%
- echo 负 场 数:%formula_win% = %res_win%
- echo ==================================================
- echo.
- echo
- pause >nul
- goto loop
复制代码 |
|