langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 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