function out(n)
for i=1 to n
out=out+cj(i-1)/i
next
end function
function cj(n)
for i=1 to n
cj=n*i
next
end function
for n=1 to 5
Text1.Text=Text1.Text&","&out(n)
next
随便写的 对不对不晓得 你自己算
Private b,n As Interger
Private Function jc(m As interger) As Interger
jc = 1
If m > 1 Then
For i = 1 To m
jc = jc * i
Next i
End If
End Function
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
n = Text1.text
If KeyCode = 13 Then
For j = 1 to n
b = b + jc(j) / j
Next j
End If
Msgbox b , VbOk + VbInformation , "输出"
End Sub
照楼主的题目,n不是大于1的正整数,应该是大于1的正偶数才对吧?
Private Sub Command1_Click()
n = Val(InputBox("n="))
If n mod 2 = 1 Then Exit Sub
t = 1 / 2
s = t
For i = 3 To n - 1 Step 2
t = t * i * (i - 1) * (i - 1) / (i + 1)
s = s + t
Next i
Print s
End Sub
Private Sub Command1_Click()
Dim J%, K%, N%, M#, S#
N = InputBox("N=?")
S = 0
For J = 2 To N
M = 1
For K = 1 To J - 1
M = M * K
Next K
S = S + M / J
Next J
Cls
Print "结果是"; S
End Sub