Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Do While Not EOF(1) Input #1, x Print #2, abc(x) Loop Close Close End End Sub Function abc(a) ans = 1 c = 1 For i = 1 To a ans = ans + c c = c + i Next abc = ans End Function
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Do While Not EOF(1)
Input #1, x
Print #2, abc(x)
Loop
Close
Close
End
End Sub
Function abc(a)
ans = 1
c = 1
For i = 1 To a
ans = ans + c
c = c + i
Next
abc = ans
End Function