Private Sub Form_Load() Me.Hide Dim m(1000), a(4) Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Do While Not EOF(1) a(1) = 1: a(2) = 5: a(3) = 10: a(4) = 50 Input #1, n For i = 0 To n m(i) = 1 Next For i = 2 To 4 For j = 1 To n If j >= a(i) Then m(j) = m(j) + m(j - a(i)) Next Next
Private Sub Form_Load()
回覆刪除Me.Hide
Dim m(1000), a(4)
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Do While Not EOF(1)
a(1) = 1: a(2) = 5: a(3) = 10: a(4) = 50
Input #1, n
For i = 0 To n
m(i) = 1
Next
For i = 2 To 4
For j = 1 To n
If j >= a(i) Then m(j) = m(j) + m(j - a(i))
Next
Next
Print #2, m(n)
Loop
Close
Close
End
End Sub