KateWilson

Функция Аккермана

Aug 20th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. def Akkerman(n, m):
  2.     if n == 0:
  3.         return (m+1)
  4.     if n != 0 and m == 0:
  5.         return Akkerman(n-1, 1)
  6.     if n > 0 and m > 0:
  7.         return (Akkerman(n-1), Akkerman(n, m-1))
Advertisement
Add Comment
Please, Sign In to add comment