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) Line Input #1, N ANS = 0 If N = "0:00" Then End M = Val(Right(N, 2)) H = Val(Left(N, 2)) X = H * 30 + M * 0.5 Y = M * 6 If X > Y Then ANS = X - Y Else ANS = Y - X End If If ANS > 180 Then ANS = 360 - ANS ANS = Format(ANS, "#0.##0") Print #2, ANS 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 While Not EOF(1)
Line Input #1, N
ANS = 0
If N = "0:00" Then End
M = Val(Right(N, 2))
H = Val(Left(N, 2))
X = H * 30 + M * 0.5
Y = M * 6
If X > Y Then
ANS = X - Y
Else
ANS = Y - X
End If
If ANS > 180 Then ANS = 360 - ANS
ANS = Format(ANS, "#0.##0")
Print #2, ANS
Loop
Close
Close
End
End Sub