Renewed Structure

This commit is contained in:
e2hang
2025-08-28 21:17:28 +08:00
parent b97f348a51
commit 1a5c4329b2
163 changed files with 312 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#include <iostream>
#include <cmath>
using namespace std;
int ack(int i, int j){
if(i == 1 && j >= 1)
return pow(2,j);
if(i >=2 && j == 1)
return ack(i - 1, 2);
if(i >= 2 && j >= 2)
return ack(i - 1, ack(i, j - 1));
return 0;
}
int main(){
cout << "1,2: " << ack(1,2) << endl;
cout << "2,1: " << ack(2,1) << endl;
cout << "2,2: " << ack(2,2) << endl;
cout << "1,3: " << ack(1,3) << endl;
return 0;
}