https://pintia.cn/problem-sets/12/problems/355
1 int Ack(int m, int n) 2 { 3 int ret; 4 5 if (m == 0) 6 { 7 ret = n + 1; 8 } 9 else if (n == 0 && m > 0) 10 { 11 ret = Ack(m - 1, 1); 12 } 13 else if (m > 0 && n > 0) 14 { 15 ret = Ack(m - 1, Ack(m, n - 1)); 16 } 17 18 return ret; 19 }
原文地址:https://www.cnblogs.com/2018jason/p/12233438.html
时间: 2024-10-09 05:05:50