已知A1=0,A2=1,A3=2,A4=A1+2*A2+A3;A5=A2+2*A3+A4...求A23
PrivateSubForm_Click()DimaAsLong,bAsLong,cAsLong,dAsLong,eAsLong,fAsLong,gAsLonga=0:b...
Private Sub Form_Click()
Dim a As Long, b As Long, c As Long, d As Long, e As Long, f As Long, g As Long
a = 0: b = 1: c = 2
For e = 1 To 20
For f = 1 To 20
For g = 1 To 20
d = a + 2 * b + c
Next g
Next f
Next e
Print d
End Sub
------------------------调试,显示结果为4,显然不可能,我错在哪咯?---------------------------------------------------------- 展开
Dim a As Long, b As Long, c As Long, d As Long, e As Long, f As Long, g As Long
a = 0: b = 1: c = 2
For e = 1 To 20
For f = 1 To 20
For g = 1 To 20
d = a + 2 * b + c
Next g
Next f
Next e
Print d
End Sub
------------------------调试,显示结果为4,显然不可能,我错在哪咯?---------------------------------------------------------- 展开
10个回答
展开全部
A3=2,也就是说.求A23
在循环体中,A4=A1+2*A2+A3,d恒等于a
+
2
*
b
+
c.,是你的程序没有实现上面的功能A1=0.,你的a,A2=1结果显然等于4;A5=A2+2*A3+A4、b
在循环体中,A4=A1+2*A2+A3,d恒等于a
+
2
*
b
+
c.,是你的程序没有实现上面的功能A1=0.,你的a,A2=1结果显然等于4;A5=A2+2*A3+A4、b
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
.结果显然等于4,是你的程序没有实现上面的功能A1=0,A2=1,A3=2,A4=A1+2*A2+A3;A5=A2+2*A3+A4...求A23
在循环体中,d恒等于a + 2 * b + c,也就是说,你的a、b、c三个变量并没有进行值的传递…….
Private Sub Command1_Click()
Dim a As Long, b As Long, c As Long, d As Long
a = 0: b = 1: c = 2
For i = 4 To 23
d = a + 2 * b + c
a = b
b = c
c = d
Next i
Print c
End Sub ,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
在循环体中,d恒等于a + 2 * b + c,也就是说,你的a、b、c三个变量并没有进行值的传递…….
Private Sub Command1_Click()
Dim a As Long, b As Long, c As Long, d As Long
a = 0: b = 1: c = 2
For i = 4 To 23
d = a + 2 * b + c
a = b
b = c
c = d
Next i
Print c
End Sub ,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
结果显然等于4,是你的程序没有实现上面的功能A1=0,A2=1,A3=2,A4=A1+2*A2+A3;A5=A2+2*A3+A4...求A23
在循环体中,d恒等于a + 2 * b + c,也就是说,你的a、b、c三个变量并没有进行值的传递……
在循环体中,d恒等于a + 2 * b + c,也就是说,你的a、b、c三个变量并没有进行值的传递……
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim a As Long, b As Long, c As Long, d As Long
a = 0: b = 1: c = 2
For i = 4 To 23
d = a + 2 * b + c
a = b
b = c
c = d
Next i
Print c
End Sub ,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
Dim a As Long, b As Long, c As Long, d As Long
a = 0: b = 1: c = 2
For i = 4 To 23
d = a + 2 * b + c
a = b
b = c
c = d
Next i
Print c
End Sub ,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
参考资料: 4 A1=0,A2=1,A3=2,A4=A1+2*A2+A3;A5=A2+2*A3+A4...求A23
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
4 A1=0,A2=1,A3=2,A4=A1+2*A2+A3;A5=A2+2*A3+A4...求A23
,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
,本来就是4的嘛,
一下子想不出关系来,只能先这样算了.
呵呵,楼上的已经做好了啊,没看到呢
Private Sub Command1_Click()
Dim a(23) As Long
a(1) = 0
a(2) = 1
a(3) = 2
For i = 4 To 23
a(i) = a(i - 3) + 2 * a(i - 2) + a(i - 1)
Next
Print a(23)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询