📜  带有批处理文件的二进制到十进制公式 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:22.707000             🧑  作者: Mango

代码示例1
@Echo off
setlocal EnableDelayedExpansion

Color 0e
Title Binary to Decimal

:Start
Set /p Bin=Binary Number?
Set Dec=0
for /L %%i in (1,1,32) do if defined Bin (
   set /A "Dec=(Dec<<1)|!Bin:~0,1!"
   set "Bin=!Bin:~1!"
)
Echo %Dec%
Pause
Goto Start