Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Ackermann-function/Batch-File/ackermann-function-1.bat
Normal file
31
Task/Ackermann-function/Batch-File/ackermann-function-1.bat
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
::Ackermann.cmd
|
||||
@echo off
|
||||
set depth=0
|
||||
:ack
|
||||
if %1==0 goto m0
|
||||
if %2==0 goto n0
|
||||
|
||||
:else
|
||||
set /a n=%2-1
|
||||
set /a depth+=1
|
||||
call :ack %1 %n%
|
||||
set t=%errorlevel%
|
||||
set /a depth-=1
|
||||
set /a m=%1-1
|
||||
set /a depth+=1
|
||||
call :ack %m% %t%
|
||||
set t=%errorlevel%
|
||||
set /a depth-=1
|
||||
if %depth%==0 ( exit %t% ) else ( exit /b %t% )
|
||||
|
||||
:m0
|
||||
set/a n=%2+1
|
||||
if %depth%==0 ( exit %n% ) else ( exit /b %n% )
|
||||
|
||||
:n0
|
||||
set /a m=%1-1
|
||||
set /a depth+=1
|
||||
call :ack %m% 1
|
||||
set t=%errorlevel%
|
||||
set /a depth-=1
|
||||
if %depth%==0 ( exit %t% ) else ( exit /b %t% )
|
||||
Loading…
Add table
Add a link
Reference in a new issue