Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, x If x <= 2 Then ans = 1 Else ans = x - 1 End If Print #2, ans Close Close End End Sub
Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, x If x <= 2 Then ans = 1 Else ans = x - 1 End If Print #2, ans 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
Input #1, x
If x <= 2 Then
ans = 1
Else
ans = x - 1
End If
Print #2, ans
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
Input #1, x
If x <= 2 Then
ans = 1
Else
ans = x - 1
End If
Print #2, ans
Close #2
Close #1
End
End Sub
Private Sub Form_Load()
回覆刪除Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, x
If x <= 2 Then
ans = 1
Else
ans = x - 1
End If
Print #2, ans
Close
Close
End
End Sub
晟晟好,
回覆刪除程式正確。
哲好,
歡迎你。
程式正確。