回复 4# qzwqzw
修改下 提升点效率 没完全测试- @echo off&setlocal enabledelayedexpansion
- set S=111111111111111111111111111111
- set F=10
- set H=2
- set "str=0123456789abcdefghijklmnopqrstuvwxyz"
- echo [%f%进制] %S%
- FOR /L %%i in (0 1 35) do (
- set _!Str:~%%i,1!=%%i
- set #!Str:~%%i,1!=!Str:~%%i,1!
- )
- :lp
- set Ln=&set R=0&set "Sn=!s!"
- for %%i in (4096 2048 1024 512 256 128 64 32 16)do if "!Sn:~%%i!" NEQ "" set/aLn+=%%i&set Sn=!Sn:~%%i!
- set Sn=!Sn!FEDCBA9876543210&set/aLn+=0x!Sn:~16,1!
- for /l %%i in (0,1,%Ln%) do (
- for %%j in ("!S:~%%i,1!") do set num=!_%%~j!&if "!#%%~j!" neq %%j set /a num+=26
- set/a "N=num+(R*F),R=N%%H,N/=H"
- for %%j in (!N!) do set M=!M!!str:~%%j,1!
- )
- set B=!str:~%r%,1!!B!
- for /f "tokens=* delims=0" %%i in ("0!M!") do set "S=%%i"
- if defined S set M=&goto lp
- echo [%H%进制] !B!
- pause
复制代码
|