VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项RT
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 02:26:29
VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项RT
VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项
RT
VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项RT
Dim a(35) As Long
Dim i As Integer = 0,j As Integer = 0
For i = 0 To 35
a(i) = Nothing '''''''''''''''''''''''''''初始化
Next
a(0) = 0
a(1) = 0
a(2) = 1
For i = 3 To 35
a(i) = a(i - 1) + a(i - 2) + a(i - 3)
Next
a1=0,a2=0,a3=1, a4=1, a5=2, a6=4, a7=7,
a8=13, a9=24, a10=44, a11=81, a12=149, a13=274,
a14=504, a15=927, a16=1705, a17=3136, a18=5768,
a19=106...
全部展开
a1=0,a2=0,a3=1, a4=1, a5=2, a6=4, a7=7,
a8=13, a9=24, a10=44, a11=81, a12=149, a13=274,
a14=504, a15=927, a16=1705, a17=3136, a18=5768,
a19=10609,
a20=19513, a21=35890, a22=66012, a23=121415, a24=223317,
a25=410744,
a26=755476, a27=1389537, a28=2555757, a29=4700770, a30=8646064,
a31=15902591,
a32=29249425, a33=53798080, a34=98950096, a35=181997601, a36=334745777。
收起