|
回复您的点评:“加上s、t互质,可略为提高效率。”
加上了,我在试试可能都无解。
代码如下:s算到4000~10000.
Private Sub Command1_Click()
Dim a, b, c
a = Val(Text1)
s = 4000
Do While Val(s) < Val(a)
t = s + 1
Do While Val(t) < Val(1 + 2 ^ 0.5) * s
If zzxc(Val(t), Val(s)) = 1 Then
m1 = MPC1(MbC(MbC(qxdcm(Val(t), 2), qxdcm(Val(s), 2)), 6), qxdcm(Val(t), 4))
m1 = MPC1(Trim(m1), qxdcm(Val(s), 4))
m1 = MPC1(Trim(m1), MbC(MbC(Val(t), qxdcm(Val(s), 3)), 4))
m1 = MPC(Trim(m1), MbC(MbC(qxdcm(Val(t), 3), Trim(s)), 4))
m = MBBC(Trim(m1))
If InStr(m, "/") = 0 Then
s1 = s1 + 1
s2 = s2 & "s=" & s & " t=" & t & " m=" & m & vbCrLf
Else
s2 = s2
End If
Else
t = t
End If
t = t + 1
Loop
s = s + 1
Loop
If Val(s1) > 0 Then
Text2 = s2
Else
Text2 = "s=" & s & " wu jie"
End If
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub
|
|