Dim money As Long Dim countt As Boolean Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As 2 Do Input #1, money If money > 10000 And countt = False Then money = money * 0.55: countt = True If money > 5000 And countt = False Then money = money * 0.6: countt = True If money > 2000 And countt = False Then money = money * 0.7: countt = True Print #2, money countt = False Loop Until EOF(1) Close #2 Close #1 End Sub
Dim money As Long Dim countt As Boolean Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As 2 Me.Hide Do Input #1, money Select Case money Case Is >= 10000 money = money * 0.55 Case Is >= 5000 money = money * 0.6 Case Is >= 2000 money = money * 0.7 End Select Print #2, money
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 Until EOF(1) Input #1, n If n > 2000 And n <= 5000 Then t = n * 0.7 If n > 5000 And n <= 10000 Then t = n * 0.6 If n > 10000 Then t = n * 0.55 Print #2, t Loop Close Close End End Sub
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 Input #1, n Select Case n Case Is > 10000 Print #2, n * 0.55 Case Is > 5000 If n <= 10000 Then Print #2, n * 0.6 Case Is > 2000 If n <= 5000 Then Print #2, n * 0.7 Case Else Print #2, n End Select Loop Until EOF(1) Close #2 Close #1 End End Sub
Dim money As Long
回覆刪除Dim countt As Boolean
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As 2
Do
Input #1, money
If money > 10000 And countt = False Then money = money * 0.55: countt = True
If money > 5000 And countt = False Then money = money * 0.6: countt = True
If money > 2000 And countt = False Then money = money * 0.7: countt = True
Print #2, money
countt = False
Loop Until EOF(1)
Close #2
Close #1
End Sub
Dim money As Long
回覆刪除Dim countt As Boolean
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As 2
Me.Hide
Do
Input #1, money
Select Case money
Case Is >= 10000
money = money * 0.55
Case Is >= 5000
money = money * 0.6
Case Is >= 2000
money = money * 0.7
End Select
Print #2, money
Loop Until EOF(1)
Close #2
Close #1
End
End Sub
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 Until EOF(1)
Input #1, n
If n > 2000 And n <= 5000 Then t = n * 0.7
If n > 5000 And n <= 10000 Then t = n * 0.6
If n > 10000 Then t = n * 0.55
Print #2, t
Loop
Close
Close
End
End Sub
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
Input #1, n
Select Case n
Case Is > 10000
Print #2, n * 0.55
Case Is > 5000
If n <= 10000 Then Print #2, n * 0.6
Case Is > 2000
If n <= 5000 Then Print #2, n * 0.7
Case Else
Print #2, n
End Select
Loop Until EOF(1)
Close #2
Close #1
End
End Sub