vb用递归法求Fibonacci数列的第20、200项
Fibonacci数列前2项均为1,满足公式f(n)=f(n-1)+f(n-2),其中n>3
人气:162 ℃ 时间:2020-05-11 07:01:48
解答
dim f() as double
n=inputbox("in","NO.")
redim f(n) as double
f(1)=1
f(2)=1
for i=3 to n
f(i)=f(i-1)+f(i-2)
next
print f(n)
推荐
猜你喜欢
- 求到原点和点(6,-2)距离相等的点的轨迹方程
- 请帮助做四小题英语试题
- 《三峡》一文中所写的三峡指长江上游的_____ _,_ _____,__ _____;.
- 三角形AAS用尺规作图如何作出来?
- 在三角形ABC中,角A,B,C的对边分别为a,b,c,a的平方=b的平方+c的平方+bc(1)求角A的大小.
- So it is not surprising that the World Wide Fund for Nature chose the giant panda as its symbol.
- y=lnx/x求导数
- “我们从事这个行业多年”,求英语翻译,