Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Ackermann-function/UNIX-Shell/ackermann-function-1.sh
Normal file
11
Task/Ackermann-function/UNIX-Shell/ackermann-function-1.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
ack() {
|
||||
local m=$1
|
||||
local n=$2
|
||||
if [ $m -eq 0 ]; then
|
||||
echo -n $((n+1))
|
||||
elif [ $n -eq 0 ]; then
|
||||
ack $((m-1)) 1
|
||||
else
|
||||
ack $((m-1)) $(ack $m $((n-1)))
|
||||
fi
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue