#include <iostream>
using namespace std;
int f(int a,int b)
{
if(a < b)
return f((b - a), a);
else if (a == b)
return 2 * a;
else
return f(f(a / 2, b), f(b, b % 2));
}
int main()
{
int a,b;
cin >> a >> b;
cout << f(a, b);
return 0;
}
【C++_Practice_函数递归】函数递归调用
猜你喜欢
转载自blog.csdn.net/qq_30638419/article/details/85342604
今日推荐
周排行