Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
42572 | 惠子铭 | 阿克曼(Ackmann)函数 | C++ | Accepted | 0 MS | 244 KB | 232 | 2024-03-01 16:01:40 |
#include<iostream> using namespace std; int ack(int m,int n){ if(m==0) return n+1; else if(n==0) return ack(m-1,1); else return ack(m-1,ack(m,n-1)); } int main() { int x,y; cin>>x>>y; cout<<ack(x,y); return 0; }