#include<iostream>
using namespace std;
int gcd(int n,int m)
{
if (n < m)
{
int temp = m;
m = n;
n = temp;
}
return m == 0 ? n : gcd(m, n % m);
}
int akm(int m, int n)
{
if (m == 0)
return n + 1;
else
return n == 0 ? akm(m - 1, 1) : akm(m - 1, akm(m, n - 1));
}
int main()
{
int m, n;
cout << "akm(m,n)的递归算法" << endl;
cout << "请输入两个数" << endl;
cin >> m >> n;
cout << akm(m, n);
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-33915.html