Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 For ai = 1 To 4 For bi = 1 To 4 If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2) Next Next Close #1 End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 For ai = 1 To 4 For bi = 1 To 4 If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) And (ai * 10 + bi) <> (bi * 10 + ai) Then mycount = mycount + 1 If mycount >= 3 And mycount <= 5 Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2) End If Next Next Close #1 End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 For ai = 3 To 4 For bi = 1 To 4 If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) And (ai * 10 + bi) <> (bi * 10 + ai) Then mycount = mycount + 1 If mycount >= 3 And mycount <= 5 Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2) End If Next Next Close #1 End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #2 For i = 1 To 3 For j = 4 To 6 r = Val(StrReverse((i & j) * 2)) If (i & j) * r = (j & i) * Val(StrReverse(r)) Then Print #1, (i & j) & "*" & r & "=" & (j & i) & "*" & Val(StrReverse(r)) Next j Next i Close #1 End End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #1
For ai = 1 To 4
For bi = 1 To 4
If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2)
Next
Next
Close #1
End
End Sub
題目說什麼做什麼不用添加太多~
回覆刪除還有像11*22 = 11 * 22 可以不用輸出
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #1
For ai = 1 To 4
For bi = 1 To 4
If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) And (ai * 10 + bi) <> (bi * 10 + ai) Then
mycount = mycount + 1
If mycount >= 3 And mycount <= 5 Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2)
End If
Next
Next
Close #1
End
End Sub
要把題目有的去掉喔
回覆刪除作者已經移除這則留言。
回覆刪除Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #1
For ai = 3 To 4
For bi = 1 To 4
If (ai * 10 + bi) * (ai * 2 + bi * 2 * 10) = (bi * 10 + ai) * (ai * 2 * 10 + bi * 2) And (ai * 10 + bi) <> (bi * 10 + ai) Then
mycount = mycount + 1
If mycount >= 3 And mycount <= 5 Then Print #1, (ai * 10 + bi) & "×" & (ai * 2 + bi * 2 * 10) & "=" & (bi * 10 + ai) & "×" & (ai * 2 * 10 + bi * 2)
End If
Next
Next
Close #1
End
End Sub
out.txt
34×86=43×68
41×28=14×82
42×48=24×84
作者已經移除這則留言。
回覆刪除作者已經移除這則留言。
回覆刪除Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #2
For i = 1 To 3
For j = 4 To 6
r = Val(StrReverse((i & j) * 2))
If (i & j) * r = (j & i) * Val(StrReverse(r)) Then Print #1, (i & j) & "*" & r & "=" & (j & i) & "*" & Val(StrReverse(r))
Next j
Next i
Close #1
End
End Sub
'out.txt
14*82=41*28
24*84=42*48
34*86=43*68