C++递推求函数F(x,n)=F(2x+1,n-1)*x(n>1)
利用C++递推方式求函数F(x,n)
F(x,1)=1
F(x,n)=F(2x+1,n-1)*x(n>1);
这个没难度,若全是int的程序参考
#include <stdio.h>
int F(int x,int n)
{
//F(x,1)=1
if (n==1)
return 1;
//F(x,n)=F(2x+1,n-1)*x(n>1);
return F(2*x+1,n-1)*x;
}
int main() //测试
{
printf("%d
",F(12,4));
return 0;
}
下一篇:差点变成瞎眼鸟。谜语猜城市2字
上一篇:燕窝。谜语猜北京建筑物2字
热门标签: