题解 | #牛牛的Ackmann#
牛牛的Ackmann
https://www.nowcoder.com/practice/3a7a4c26420c4358a1a5cda3da2fa1c8
#include <stdio.h> long long Ackmann(int m, int n) { if (m == 0) { return n + 1; } if (m > 0 && n == 0) { return Ackmann(m - 1, 1); } if (m > 0 && n > 0) { return Ackmann(m - 1, Ackmann(m, n - 1)); } else { return -1; } } int main() { int n, m = 0; scanf("%d %d", &n, &m); printf("%lld\n", Ackmann(m, n)); return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目