Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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