题解 | #牛牛的Ackmann#
牛牛的Ackmann
https://www.nowcoder.com/practice/3a7a4c26420c4358a1a5cda3da2fa1c8
#include <stdio.h> #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> long long x=0; int ackmann(long long m,long long n) { if(m==0) { return n+1; } if(m==1) { return n+2; } if(m==2) { return 2*n+3; } if(m>0&&n==0) return ackmann(m-1,1); if(m==3) return ackmann(m-1,ackmann(m,n-1)); return 0; } int main() { int n; int m; scanf("%d %d",&n,&m); printf("%lld",ackmann(m,n)); return 0; }