Dim A(5, 5) As Integer
Sub SaveData()
Open App.Path & "\" & "PROGIN.DAT" For Input As #1
Open App.Path & "\" & "PROGOUT.DAT" For Output As #2
For k = 1 To 2
For i = 1 To 5
For j = 1 To 5
Input #1, A(i, j)
Next j
Next i
Print #2, "最小值为:" & Fun(A)
Next k
Close #1
Close #2
End Sub
Function Fun(A() As Integer)
'********begin********
'*********end*********
End Function
Private Sub Command1_Click()
Dim i%, j%
Form1.Cls
Randomize
For i = 1 To 5
For j = 1 To 5
A(i, j) = Int(Rnd * 81) + 20
Print A(i, j);
Next j
Print
Next i
End Sub
Private Sub Command2_Click()
min = Fun(A)
Print "最小值为:"; min
SaveData
End Sub
Dim A(5, 5) As Integer
答案:1 悬赏:0 手机版
解决时间 2021-02-04 16:26
- 提问者网友:夢醒日落
- 2021-02-03 18:02
最佳答案
- 五星知识达人网友:妄饮晩冬酒
- 2021-02-03 19:26
Function Fun(A() As Integer)
'********begin********
dim min as Integer
min=a(1,1)
for i=1 to 5
for j=1 to 5
if a(i,j)<min then
min=a(i,j)
end if
next j
next i
Fun=min
'*********end*********
End Function
'********begin********
dim min as Integer
min=a(1,1)
for i=1 to 5
for j=1 to 5
if a(i,j)<min then
min=a(i,j)
end if
next j
next i
Fun=min
'*********end*********
End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯