第一题VB作业的代码怎么写,谢谢
展开全部
Private Sub ni_Click()
End Sub
Public Function GetHLS(A() As Integer) As Double
If UBound(A) = 1 Then
GetHLS = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0)
End If
If UBound(A) > 1 Then
Dim RRes As Double
Dim LRes As Double
Dim CNum As Integer
Dim TNum As Double
Dim i As Integer
RRes = 0
LRes = 0
For i = 0 To UBound(A)
CNum = i
TNum = 1
If i = 0 Then
For j = 0 To UBound(A)
TNum = TNum * A(j, j)
Next j
End If
If i > 0 Then
Call YD(i)
For j = 0 To UBound(A)
TNum = TNum * A(j, cc(j))
Next j
End If
RRes = RRes + TNum
Next i
For i = 0 To UBound(A)
CNum = i
TNum = 1
If i = 0 Then
For j = 0 To UBound(A)
TNum = TNum * A(j, UBound(A) - j)
Next j
End If
If i > 0 Then
Call YD(i)
For j = 0 To UBound(A)
TNum = TNum * A(UBound(A) - j, cc(j))
Next j
End If
LRes = LRes + TNum
Next i
GetHLS = RRes - LRes
End If
End Function
Public Sub YD(N As Integer)
Dim n1 As Integer
n1 = UBound(aa)
ReDim bb(n1)
ReDim cc(n1)
For i = 0 To n1 - N
bb(i) = aa(N + i)
Next
For i = 0 To n1 - N
cc(i) = bb(i)
Next
For i = n1 - N + 1 To n1
cc(i) = aa(i - n1 + N - 1)
Next
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
什么毛病,求人家帮助,自己还不把图像放正?
追问
难道看不清嘛
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询