tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
14
Task/Binary-digits/Batch-File/binary-digits.bat
Normal file
14
Task/Binary-digits/Batch-File/binary-digits.bat
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@echo off
|
||||
:num2bin IntVal [RtnVar]
|
||||
setlocal enableDelayedExpansion
|
||||
set /a n=%~1
|
||||
set rtn=
|
||||
for /l %%b in (0,1,31) do (
|
||||
set /a "d=n&1, n>>=1"
|
||||
set rtn=!d!!rtn!
|
||||
)
|
||||
for /f "tokens=* delims=0" %%a in ("!rtn!") do set rtn=%%a
|
||||
(endlocal & rem -- return values
|
||||
if "%~2" neq "" (set %~2=%rtn%) else echo %rtn%
|
||||
)
|
||||
exit /b
|
||||
Loading…
Add table
Add a link
Reference in a new issue