一道vb题1!-2!···
题目:(事件)单击窗体。(响应)已知sum=1!-2!+3!-4!···-10!将sum结果值输出到窗体上。实用dowhile···loop语句完成程序答对我会增加财富值...
题目:(事件)单击窗体。
(响应)已知sum=1!-2!+3!-4!···-10!
将sum结果值输出到窗体上。
实用do while···loop语句完成程序
答对我会增加财富值的!!谢谢 展开
(响应)已知sum=1!-2!+3!-4!···-10!
将sum结果值输出到窗体上。
实用do while···loop语句完成程序
答对我会增加财富值的!!谢谢 展开
展开全部
Private Sub Form_Click()
Dim j As Double, sum As Double, n As Integer, fh as integer
j = 1
n = 1
fh = 1 '控制符号,第一为1 ,n=2时为-1
Do While n <= 10
j = j * n
sum = sum + j * fh
fh = - fh
n = n + 1
Loop
Print sum
End Sub
Dim j As Double, sum As Double, n As Integer, fh as integer
j = 1
n = 1
fh = 1 '控制符号,第一为1 ,n=2时为-1
Do While n <= 10
j = j * n
sum = sum + j * fh
fh = - fh
n = n + 1
Loop
Print sum
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-12-30
展开全部
Private Sub Form_Click()
Dim jc As Double, sum As Double, n As Integer
jc = 1
n = 1
Do While n <= 10
jc = jc * n
sum = sum + jc
n = n + 1
Loop
Print sum
End Sub
Dim jc As Double, sum As Double, n As Integer
jc = 1
n = 1
Do While n <= 10
jc = jc * n
sum = sum + jc
n = n + 1
Loop
Print sum
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-12-30
展开全部
Private Sub Form_Click()
Dim j As Double, sum As Double, n As Integer, k as integer
j = 1
n = 1
k = 1
Do While n <= 10
j = j * n
sum = sum + j * k
k = - k
n = n + 1
Loop
Print sum
End Sub
Dim j As Double, sum As Double, n As Integer, k as integer
j = 1
n = 1
k = 1
Do While n <= 10
j = j * n
sum = sum + j * k
k = - k
n = n + 1
Loop
Print sum
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询