- 积分
- 492
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Private Sub Command1_Click()
Dim a(5, 5) As Double, b(5, 5) As Double, i%, j%, k%, l%, m%
Randomize
a(1, 1) = Text1.Text
a(1, 2) = Text2.Text
a(1, 3) = Text3.Text
a(1, 4) = Text4.Text
a(1, 5) = Text5.Text
a(2, 1) = Text6.Text
a(2, 2) = Text7.Text
a(2, 3) = Text8.Text
a(2, 4) = Text9.Text
a(2, 5) = Text10.Text
a(3, 1) = Text11.Text
a(3, 2) = Text12.Text
a(3, 3) = Text13.Text
a(3, 4) = Text14.Text
a(3, 5) = Text15.Text
a(4, 1) = Text16.Text
a(4, 2) = Text17.Text
a(4, 3) = Text18.Text
a(4, 4) = Text19.Text
a(4, 5) = Text20.Text
a(5, 1) = Text21.Text
a(5, 2) = Text22.Text
a(5, 3) = Text23.Text
a(5, 4) = Text24.Text
a(5, 5) = Text25.Text
k = Text26.Text
For i = 1 To 5
For j = 1 To 5
If i = k And j = k Then
b(i, j) = 1 / a(k, k)
End If
If i <> k And j <> k Then
b(i, j) = a(i, j) - a(k, j) * a(i, k) / a(k, k)
End If
If i = k And j <> k Then
b(i, j) = a(k, j) / a(k, k)
End If
If i <> k And j = k Then
b(i, j) = -a(i, k) / a(k, k)
End If
Next
Next
For l = 1 To 5
For m = 1 To 5
Text1.Text = b(1, 1)
Text2.Text = b(1, 2)
Text3.Text = b(1, 3)
Text4.Text = b(1, 4)
Text5.Text = b(1, 5)
Text6.Text = b(2, 1)
Text7.Text = b(2, 2)
Text8.Text = b(2, 3)
Text9.Text = b(2, 4)
Text10.Text = b(2, 5)
Text11.Text = b(3, 1)
Text12.Text = b(3, 2)
Text13.Text = b(3, 3)
Text14.Text = b(3, 4)
Text15.Text = b(3, 5)
Text16.Text = b(4, 1)
Text17.Text = b(4, 2)
Text18.Text = b(4, 3)
Text19.Text = b(4, 4)
Text20.Text = b(4, 5)
Text21.Text = b(5, 1)
Text22.Text = b(5, 2)
Text23.Text = b(5, 3)
Text24.Text = b(5, 4)
Text25.Text = b(5, 5)
Next
Next
End Sub
|
|