daily pastebin goal
46%
SHARE
TWEET

ackermann td

a guest Feb 20th, 2019 73 in 3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int Ackermann(int m = 0, int n = 0){
  2.  
  3.     int res;
  4.     if (m == 0){
  5.         res = n + 1;
  6.     } else if (n == 0){
  7.         res = Ackermann(m - 1,1);
  8.     } else {
  9.         res = Ackermann(m -1, Ackermann(m, n - 1));
  10.     }
  11.     return res;
  12. }
  13.  
  14. int main(){
  15.     cout << Ackermann(2, 6) << endl;
  16.     return 0;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top