Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Count-in-octal/Batch-File/count-in-octal.bat
Normal file
25
Task/Count-in-octal/Batch-File/count-in-octal.bat
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@echo off
|
||||
:: {CTRL + C} to exit the batch file
|
||||
|
||||
:: Send incrementing decimal values to the :to_Oct function
|
||||
set loop=0
|
||||
:loop1
|
||||
call:to_Oct %loop%
|
||||
set /a loop+=1
|
||||
goto loop1
|
||||
|
||||
:: Convert the decimal values parsed [%1] to octal and output them on a new line
|
||||
:to_Oct
|
||||
set todivide=%1
|
||||
set "fulloct="
|
||||
|
||||
:loop2
|
||||
set tomod=%todivide%
|
||||
set /a appendmod=%tomod% %% 8
|
||||
set fulloct=%appendmod%%fulloct%
|
||||
if %todivide% lss 8 (
|
||||
echo %fulloct%
|
||||
exit /b
|
||||
)
|
||||
set /a todivide/=8
|
||||
goto loop2
|
||||
Loading…
Add table
Add a link
Reference in a new issue