Private Sub Form_Load() Me.Hide Dim x, y, ans As Double 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, y ans = 0 For i = 1 To x If x Mod i = 0 Then If i Mod y = 0 Then ans = ans + 1 End If Next 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) Input #1, n, d ans = 0 For i = 1 To n If (n Mod i = 0) And (i Mod d = 0) Then ans = ans + 1 End If Next i Print #2, ans Loop 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 While Not EOF(1) Input #1, x, y ans = 0 For i = 2 To x If x Mod i = 0 Then If i Mod y = 0 Then ans = ans + 1 End If Next i Print #2, ans Loop 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 While Not EOF(1) ans = 0 Input #1, a, b For i = 1 To Val(a) If Val(a) Mod Val(i) = 0 Then If Val(i) Mod Val(b) = 0 Then ans = ans + 1 End If Next i Print #2, ans Loop Close #2 Close #1 End End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Dim x, y, ans As Double
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, y
ans = 0
For i = 1 To x
If x Mod i = 0 Then
If i Mod y = 0 Then ans = ans + 1
End If
Next
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)
Input #1, n, d
ans = 0
For i = 1 To n
If (n Mod i = 0) And (i Mod d = 0) Then
ans = ans + 1
End If
Next i
Print #2, ans
Loop
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 While Not EOF(1)
Input #1, x, y
ans = 0
For i = 2 To x
If x Mod i = 0 Then
If i Mod y = 0 Then ans = ans + 1
End If
Next i
Print #2, ans
Loop
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 While Not EOF(1)
ans = 0
Input #1, a, b
For i = 1 To Val(a)
If Val(a) Mod Val(i) = 0 Then
If Val(i) Mod Val(b) = 0 Then ans = ans + 1
End If
Next i
Print #2, ans
Loop
Close #2
Close #1
End
End Sub