Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, n Call A1(n) Close Close End End Sub
Sub A1(a) Dim s, m m = 99999 s = Split(a, ",") For i = 0 To UBound(s) If Val(s(i)) < m Then m = s(i) Next Print #2, m End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #2
Open App.Path & "\in.txt" For Input As #1
Input #1, x
Do While Not EOF(1)
Input #1, y
If x > y Then x = y
Loop
Print #2, x
Close #1
Close #2
End
End Sub
緣尉好,
回覆刪除這題OK。(雖然似乎和12月開始的arro有重複,沒關係啦,這兒空間不是問題。)
熊掌
Private Sub Form_Load()
回覆刪除Me.Hide
Dim a, b
Open App.Path & "\in.txt" For Input As #1
Input #1, b
Do While Not EOF(1)
Input #1, a
If a < b Then b = a
Loop
Close #1
Open App.Path & "\out.txt" For Output As #2
Print #2, b
Close #2
End
End Sub
Dim n As Integer
回覆刪除Dim A As Integer
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Input #1, n
Do While Not EOF(1)
Input #1, A
If n > A Then n = A
Loop
Close #1
Open App.Path & "\out.txt" For Output As #2
Print #2, n
Close #2
End
End Sub
Arro,佑好,
回覆刪除程式正確。
熊掌
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, n
Call A1(n)
Close
Close
End
End Sub
Sub A1(a)
Dim s, m
m = 99999
s = Split(a, ",")
For i = 0 To UBound(s)
If Val(s(i)) < m Then m = s(i)
Next
Print #2, m
End Sub
1:45