Код: Выделить всё
#include
using namespace std;
int max(int a, int b)
{
if(a>b)return a;
return b;
}
int f(int a, int b)
{
if(a==0)return b;
return max( f(a-1,2*b), f(a-1,2*b+1) );
}
int main()
{
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/21099619/recursive-function-help-me-understand-it-by-pen-and-paper[/url]
Мобильная версия